Skip to content

Commit d9dced1

Browse files
Fix the dataset loading for custom tasks (#364)
* init * extra fix for Elie: max_length should always be a property --------- Co-authored-by: Nathan Habib <[email protected]>
1 parent 8b47ec1 commit d9dced1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/lighteval/models/endpoint_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def cleanup(self):
149149
"You deleted your endpoint after using it. You'll need to create it again if you need to reuse it."
150150
)
151151

152+
@property
152153
def max_length(self):
153154
if self._max_length is not None:
154155
return self._max_length

src/lighteval/tasks/registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def create_custom_tasks_module(custom_tasks: Union[str, Path, ModuleType]) -> Mo
255255
if isinstance(custom_tasks, ModuleType):
256256
return custom_tasks
257257
if isinstance(custom_tasks, (str, Path)) and os.path.exists(custom_tasks):
258-
dataset_module = dataset_module_factory(str(custom_tasks))
258+
dataset_module = dataset_module_factory(str(custom_tasks), trust_remote_code=True)
259259
return importlib.import_module(dataset_module.module_path)
260260
if isinstance(custom_tasks, (str, Path)):
261261
return importlib.import_module(str(custom_tasks))

0 commit comments

Comments
 (0)