Skip to content

Commit 11ed00d

Browse files
authored
fix custom model example (#766)
1 parent b599ddf commit 11ed00d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/custom_models/google_translate_model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(self, config) -> None:
5555
self.model_definition_file_path = config.model_definition_file_path
5656

5757
self.model_info = ModelInfo(
58-
model_name=config.model,
58+
model_name=config.model_name,
5959
model_sha="",
6060
model_dtype=None,
6161
model_size="",
@@ -132,14 +132,14 @@ def greedy_until(
132132
dataset = GenerativeTaskDataset(requests=requests, num_dataset_splits=self.DATASET_SPLITS)
133133
results = []
134134

135-
for _ in tqdm(
136-
dataset.splits_start_end_iterator(),
135+
for split in tqdm(
136+
dataset.splits_iterator(),
137137
total=dataset.num_dataset_splits,
138138
desc="Splits",
139139
position=0,
140140
disable=False, # self.disable_tqdm,
141141
):
142-
for r in tqdm(dataset, desc="Batch", position=1, disable=False):
142+
for r in tqdm(split, desc="Batch", position=1, disable=False):
143143
# Extract source and target languages from task name
144144
# Format is like "community|sdst-text_level:de-fr|0"
145145
src_lang, tgt_lang = r.task_name.split("|")[1].split(":")[-1].split("-")

src/lighteval/main_custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def custom(
117117
)
118118

119119
parallelism_manager = ParallelismManager.CUSTOM
120-
model_config = CustomModelConfig(model=model_name, model_definition_file_path=model_definition_file_path)
120+
model_config = CustomModelConfig(model_name=model_name, model_definition_file_path=model_definition_file_path)
121121

122122
pipeline_params = PipelineParameters(
123123
launcher_type=parallelism_manager,

0 commit comments

Comments
 (0)