lm-sys / lm-sys/FastChat

Is the conversation template tied to a `model_id` or to a `model_path`?

Open
#2,950 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
39.5k
Forks
4.8k
PR merge metrics
No merged PRs in 30d

Description

In `gen_model_answer.py`, a conversation template is loaded by checking `model_id`

https://github.com/lm-sys/FastChat/blob/8163cb2719b3155fd5b83dd0bf4190f61a847a6d/fastchat/llm_judge/gen_model_answer.py#L107

However, the function definition suggests to me that `model_path` might be the intended input:

https://github.com/lm-sys/FastChat/blob/8163cb2719b3155fd5b83dd0bf4190f61a847a6d/fastchat/model/model_adapter.py#L374-L377

Other parts of the codebase seem to suggest this as well, e.g., `load_model` seems to `load_adapter(model_path)`

https://github.com/lm-sys/FastChat/blob/8163cb2719b3155fd5b83dd0bf4190f61a847a6d/fastchat/model/model_adapter.py#L196

If `model_id == model_path` (or at least they are somewhat similar), then I think this doesn't cause a problem (e.g., if model path points to an HF repo and the model_id is also the model's name, e.g., model_path is `databricks/dolly-v2-12b` and model_id is `dolly-v2`), but if they are wildly different (e.g., maybe model_id is an internal name given to the model) then this can lead to the wrong conversation template getting loaded.

I _suspect_ that this might be a slight bug, and `model_path` should be the one used in

https://github.com/lm-sys/FastChat/blob/8163cb2719b3155fd5b83dd0bf4190f61a847a6d/fastchat/llm_judge/gen_model_answer.py#L107

...but maybe this behavior is actually expected. If it is expected, I think this should be clarified in the [docs over here](https://github.com/lm-sys/FastChat/tree/main/fastchat/llm_judge#evaluate-a-model-on-mt-bench) since (at least to me) the docs suggest that the model id is just a label, e.g., for the benchmark itself.

Either way, thanks for making this library---it's super useful and very easy to use! 😃

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read fastchat/llm_judge/gen_model_answer.py around line 107 and fastchat/model/model_adapter.py around lines 196 and 374-377 to trace whether conversation templates use model_id or model_path. Check the MT-Bench evaluation documentation, then establish the intended identifier and either correct the lookup or clarify the behavior in the docs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.