opencompass icon indicating copy to clipboard operation
opencompass copied to clipboard

[Feature] _set_model_kwargs_torch_dtype in _load_model will overide the torch_dtype in the config.json of any given huggingface models by default

Open imhmhm opened this issue 6 months ago • 1 comments

Describe the feature

https://github.com/open-compass/opencompass/blob/52eccc4f0efd3ca6f272ae19efb2d7f6cc9c9dec/opencompass/models/huggingface_above_v4_33.py#L213

image

In most cases people who import any huggingface model by the argument --hf-path might think the "torch_dtype" in the config.json will take effect, but the "_load_model" function will always overide it with float16 by calling "_set_model_kwargs_torch_dtype" if not any line like "--model-kwargs torch_dtype='xxx'" is added to your command lines.

It would be better to check the "torch_dtype" in the config.json first.

Will you implement it?

  • [ ] I would like to implement this feature and create a PR!

imhmhm avatar Jul 30 '24 14:07 imhmhm