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

Error when chat template is not a string #1962

Open
djstrong opened this issue Jun 13, 2024 · 1 comment
Open

Error when chat template is not a string #1962

djstrong opened this issue Jun 13, 2024 · 1 comment

Comments

@djstrong
Copy link
Contributor

E.g. Mixtral has more than one template https://huggingface.co/mistralai/Mixtral-8x22B-Instruct-v0.1/blob/main/tokenizer_config.json

Traceback (most recent call last):
  File "/venv/bin/lm_eval", line 8, in <module>
    sys.exit(cli_evaluate())
  File "/lm-evaluation-harness/lm_eval/__main__.py", line 369, in cli_evaluate
    results = evaluator.simple_evaluate(
  File "/lm-evaluation-harness/lm_eval/utils.py", line 346, in _wrapper
    return fn(*args, **kwargs)
  File "/lm-evaluation-harness/lm_eval/evaluator.py", line 269, in simple_evaluate
    evaluation_tracker.general_config_tracker.log_experiment_args(
  File "/lm-evaluation-harness/lm_eval/loggers/evaluation_tracker.py", line 89, in log_experiment_args
    self.chat_template_sha = hash_string(chat_template) if chat_template else None
  File "/lm-evaluation-harness/lm_eval/utils.py", line 36, in hash_string
    return hashlib.sha256(string.encode("utf-8")).hexdigest()
AttributeError: 'dict' object has no attribute 'encode'

I guess just add str(). However, will it work later?

@haileyschoelkopf
Copy link
Contributor

We should allow one to specify which chat template to use when there are multiple--potentially allowing for --apply_chat_template {template_name} as an arg format in addition to the current default?

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

2 participants