Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brain-score.org (user:374) | Add new plugin(s): #225

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions brainscore_language/models/gpt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@

model_registry['gpt-neo-1.3B'] = lambda: HuggingfaceSubject(model_id='EleutherAI/gpt-neo-1.3B', region_layer_mapping={
ArtificialSubject.RecordingTarget.language_system: 'transformer.h.18'})

model_registry['gpt-j-6b'] = lambda: HuggingfaceSubject(model_id='EleutherAI/gpt-j-6b', region_layer_mapping={
ArtificialSubject.RecordingTarget.language_system: 'transformer.h.26'})
11 changes: 8 additions & 3 deletions brainscore_language/models/gpt/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
('gpt-neo-2.7B', [np.nan, 15.07522869, 3.6358602 , 0.04999408, 1.42219079,
0.0399301 , 0.02614061, 0.02547451]),
('gpt-neo-1.3B', [np.nan, 15.36009979, 5.54412651, 0.11744193, 0.60116327,
0.04266951, 0.08952015, 0.09213546])
0.04266951, 0.08952015, 0.09213546]),
('gpt-j-6b', [np.nan, 1.335768e+01, 1.618860e+00, 1.210055e-02,
3.879260e-01, 4.501237e-02, 5.057606e-02, 9.547059e-02]),

])
def test_reading_times(model_identifier, expected_reading_times):
model = load_model(model_identifier)
Expand All @@ -44,7 +47,8 @@ def test_reading_times(model_identifier, expected_reading_times):
('gpt2-xl', ['jumps', 'the', 'dog']),
('gpt-neo-125m', [',', 'the', 'dog']),
('gpt-neo-2.7B', ['jumps', 'the', 'dog']),
('gpt-neo-1.3B', ['jumps', 'the', 'dog'])
('gpt-neo-1.3B', ['jumps', 'the', 'dog']),
('gpt-j-6b', ['jumps', 'the', 'dog']),
])
def test_next_word(model_identifier, expected_next_words):
model = load_model(model_identifier)
Expand All @@ -64,7 +68,8 @@ def test_next_word(model_identifier, expected_next_words):
('gpt2-xl', 1600),
('gpt-neo-125m', 768),
('gpt-neo-1.3B', 2048),
('gpt-neo-2.7B', 2560)
('gpt-neo-2.7B', 2560),
('gpt-j-6b', 4096),
])
def test_neural(model_identifier, feature_size):
model = load_model(model_identifier)
Expand Down
Loading