Skip to content

Commit be36918

Browse files
author
Jonathan
committed
Another fix to call llama functions.
1 parent 45af393 commit be36918

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Diff for: llm_eval/handler.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,13 @@ def prepare_output(self):
8585
df = pd.concat([df, pd.DataFrame(rows)], ignore_index=True)
8686
return df
8787

88-
8988
def process_dataset(self):
9089
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():
9291
self.current_model = model_name
9392
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():
9695
print(f"Generating outputs for {row['id']}")
9796
for col in df.columns:
9897
if col.endswith('.input'):
@@ -103,7 +102,6 @@ def process_dataset(self):
103102
self.unload_model(model_name)
104103
return df
105104

106-
107105
def unload_model(self, model_id):
108106
del self.model, self.tokenizer
109107
import torch

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "llm-eval"
9-
version = "0.6.1"
9+
version = "0.6.2"
1010
authors = [
1111
{name = "Jonathan Eisenzopf", email = "[email protected]"},
1212
]

0 commit comments

Comments
 (0)