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

Fix trust_remote_code #1493

Merged
merged 1 commit into from
Nov 20, 2024
Merged
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
8 changes: 8 additions & 0 deletions examples/text-generation/run_lm_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ def main():
args = setup_lm_eval_parser()
model, _, tokenizer, generation_config = initialize_model(args, logger)

if args.trust_remote_code:
# trust_remote_code fix was introduced in lm_eval 0.4.3
# https://github.com/EleutherAI/lm-evaluation-harness/pull/1998/files
# We need to cherry-pick the fix manually untill we upgrade (SW-190418)
import datasets

datasets.config.HF_DATASETS_TRUST_REMOTE_CODE = True

lm_tasks = lm_eval.tasks.get_task_dict(args.tasks)
with torch.no_grad():
lm = HabanaModelAdapter(tokenizer, model, args, generation_config)
Expand Down
Loading