File tree 2 files changed +4
-6
lines changed
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -85,14 +85,13 @@ def prepare_output(self):
85
85
df = pd .concat ([df , pd .DataFrame (rows )], ignore_index = True )
86
86
return df
87
87
88
-
89
88
def process_dataset (self ):
90
89
df = self .prepare_output ()
91
- for model_name , model_handler in self .models .items (): # Unpack the tuple correctly
90
+ for model_name , model_handler in self .models .items ():
92
91
self .current_model = model_name
93
92
print (f"Loading { model_name } ..." )
94
- self .tokenizer , self .model = model_handler .load_model_and_tokenizer (model_name )
95
- for index , row in df [df ['model' ] == model_name ].iterrows (): # Process the correct group rather than the entire df
93
+ self .tokenizer , self .model = model_handler () .load_model_and_tokenizer (model_name )
94
+ for index , row in df [df ['model' ] == model_name ].iterrows ():
96
95
print (f"Generating outputs for { row ['id' ]} " )
97
96
for col in df .columns :
98
97
if col .endswith ('.input' ):
@@ -103,7 +102,6 @@ def process_dataset(self):
103
102
self .unload_model (model_name )
104
103
return df
105
104
106
-
107
105
def unload_model (self , model_id ):
108
106
del self .model , self .tokenizer
109
107
import torch
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
7
7
[project ]
8
8
name = " llm-eval"
9
- version = " 0.6.1 "
9
+ version = " 0.6.2 "
10
10
authors = [
11
11
{
name =
" Jonathan Eisenzopf" ,
email =
" [email protected] " },
12
12
]
You can’t perform that action at this time.
0 commit comments