THUDM / SwissArmyTransformer

SwissArmyTransformer is a flexible and powerful library to develop your own Transformer variants.
https://THUDM.github.io/SwissArmyTransformer
Apache License 2.0
1.02k stars 98 forks source link

AutoModel.from_pretrained()里面不能加载hf版本的权重吗 #169

Open AlenjandroWang opened 10 months ago

AlenjandroWang commented 10 months ago

File "demo.py", line 44, in model, model_args =AutoModel.from_pretrained('/code/CogVLM-main/vicuna-7b-v1.5', args=argparse.Namespace( File "/opt/conda/lib/python3.8/site-packages/sat/model/base_model.py", line 337, in from_pretrained return cls.from_pretrained_base(name, args=args, home_path=home_path, url=url, prefix=prefix, build_only=build_only, overwrite_args=overwrite_args, **kwargs) File "/opt/conda/lib/python3.8/site-packages/sat/model/base_model.py", line 318, in from_pretrained_base args = update_args_with_file(args, path=os.path.join(model_path, 'model_config.json')) File "/opt/conda/lib/python3.8/site-packages/sat/arguments.py", line 454, in update_args_with_file with open(path, 'r', encoding='utf-8') as f: FileNotFoundError: [Errno 2] No such file or directory: '/code/CogVLM-main/vicuna-7b-v1.5/model_config.json'

1049451037 commented 10 months ago

不能,如果想加载可以先转换成sat格式:https://github.com/THUDM/SwissArmyTransformer/tree/main/examples/llama

transform_param.py