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

trust_remote_code is not passed to AutoTokenizer.from_pretrained #87

Open
KlaudiaTH opened this issue Jun 20, 2023 · 0 comments
Open

trust_remote_code is not passed to AutoTokenizer.from_pretrained #87

KlaudiaTH opened this issue Jun 20, 2023 · 0 comments

Comments

@KlaudiaTH
Copy link
Collaborator

Error while running:

python $EVAL_INSTALLATION_DIR/main.py \
 --model hf-causal-experimental \
 --model_args pretrained=$PATH_TO_CONVERTED_CHECKPOINT,trust_remote_code=True,use_accelerate=True,device_map_option=balanced \
 --batch_size 10 \
 --tasks  wsc  \
--no_cache
Traceback (most recent call last):
  File "/p/project/opengptx-elm/thellmann1/workdir/lm_eval_setup/lm-evaluation-harness/main.py", line 93, in <module>
    main()
  File "/p/project/opengptx-elm/thellmann1/workdir/lm_eval_setup/lm-evaluation-harness/main.py", line 59, in main
    results = evaluator.simple_evaluate(
  File "/p/project/opengptx-elm/thellmann1/workdir/lm_eval_setup/lm-evaluation-harness/lm_eval/utils.py", line 243, in _wrapper
    return fn(*args, **kwargs)
  File "/p/project/opengptx-elm/thellmann1/workdir/lm_eval_setup/lm-evaluation-harness/lm_eval/evaluator.py", line 72, in simple_evaluate
    lm = lm_eval.models.get_model(model).create_from_arg_string(
  File "/p/project/opengptx-elm/thellmann1/workdir/lm_eval_setup/lm-evaluation-harness/lm_eval/base.py", line 115, in create_from_arg_string
    return cls(**args, **args2)
  File "/p/project/opengptx-elm/thellmann1/workdir/lm_eval_setup/lm-evaluation-harness/lm_eval/models/huggingface.py", line 201, in __init__
    self.tokenizer = self._create_auto_tokenizer(
  File "/p/project/opengptx-elm/thellmann1/workdir/lm_eval_setup/lm-evaluation-harness/lm_eval/models/huggingface.py", line 502, in _create_auto_tokenizer
    tokenizer = super()._create_auto_tokenizer(
  File "/p/project/opengptx-elm/thellmann1/workdir/lm_eval_setup/lm-evaluation-harness/lm_eval/models/huggingface.py", line 335, in _create_auto_tokenizer
    tokenizer = self.AUTO_TOKENIZER_CLASS.from_pretrained(
  File "/p/project/opengptx-elm/thellmann1/workdir/lm_eval_setup/pyenv_lmeval/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py", line 688, in from_pretrained
    raise ValueError(
ValueError: Tokenizer class HFBloomTokenizerFast does not exist or is not currently imported.
transformers/src/transformers/models/auto/tokenization_auto.py

Solution: A patch where trust_remote_code from model_args is passed to AutoTokenizer.from_pretrained

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant