huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
131.97k stars 26.29k forks source link

Covert chemaleon weights to hf, ImportError #33116

Open ChinChyi opened 2 weeks ago

ChinChyi commented 2 weeks ago

System Info

ImportError: cannot import name 'ChameleonForCausalLM' from 'transformers'  (/mnt/petrelfs/xxxx/miniconda3/envs/lumina_mgpt/lib/python3.10/site-packages/transformers/__init__.py)

Information

Tasks

Reproduction

python src/transformers/models/chameleon/convert_chameleon_weights_to_hf.py --input_dir /mnt/petrelfs/q-pth --model_size 7B --output_dir /mnt/petrelfs

Expected behavior

Hope this is fixed

Checklist

ArthurZucker commented 2 weeks ago

Hey @ChinChyi, you should make sure that transformers is installed using pip install -e .

ChinChyi commented 2 weeks ago

Hey @ChinChyi, you should make sure that transformers is installed using pip install -e .

@ArthurZucker I've installed transformers with this and I'm still getting this error

ArthurZucker commented 2 weeks ago

Ah you are completely right! The class is ChameleonForConditionalGeneration ! Would you like to open a PR to fix the class in the conversion script? 🤗