young-geng / EasyLM

Large language models (LLMs) made easy, EasyLM is a one stop solution for pre-training, finetuning, evaluating and serving LLMs in JAX/Flax.
Apache License 2.0
2.33k stars 247 forks source link

transformers version doesn't support Llama conversion to huggingface format #62

Closed ruiqi-zhong closed 1 year ago

ruiqi-zhong commented 1 year ago

the transformers version transformers==4.27.2 in the scripts/gpu_environment.yml file leads to an import issue when I ran EasyLM.models.llama.convert_easylm_to_hf

File "/scratch/users/ruiqi-zhong/conda/envs/EasyLM/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/scratch/users/ruiqi-zhong/conda/envs/EasyLM/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/scratch/users/ruiqi-zhong/EasyLM/EasyLM/models/llama/convert_easylm_to_hf.py", line 33, in <module>
    from transformers import LlamaConfig, LlamaForCausalLM
ImportError: cannot import name 'LlamaConfig' from 'transformers'

It can be easily fixed after pip install-ing the latest transformers library, though.

young-geng commented 1 year ago

Indeed I should update the transformers version. When I initially wrote that script, the LLaMA class in transformers library hasn't been released yet.