论文链接:https://arxiv.org/abs/2304.08467
1、首先下载llama-7b模型,flant5没下载
下载地址:https://huggingface.co/jayelm/llama-7b-gist-1/tree/main
2、按照说明安装环境
pip install -r requirements.txt
3、问题记录
**
问题一:
**
pydantic.errors.PydanticUserError: If you use @root_validator
with pre=False (the default) you MUST specify skip_on_failure=True
. Note that @root_validator
is deprecated and should be replaced with @model_validator
.
原因:pydantic版本不符,需要降级
解决方法:
(1)查看自己的pydantic,我的版本为2.4.2
pip show pydantic
(2)卸载当前pydantic
pip uninstall pydantic
(3)安装新的pydantic
pip install pydantic==1.10.9
ok,问题解决
问题二
OSError: Can’t load the configuration of ’ --instruction’. If you were trying to load it from ‘https://huggingface.co/models’, make sure you don’t have a local directory with the same name. Otherwise, make sure ’ --instruction’ is the correct path to a directory containing a config.json file
原因:我是一个傻杯
解决方法:将–model_name_or_path jayelm/llama-7b-gist-1里的jayelm/llama-7b-gist-1换成你自己下载的模型的地址,地址一定要对啊?我搞了快一天了,发现地址放错路径了,快要吐血了。
python -m src.compress --model_name_or_path jayelm/llama-7b-gist-1 --base_llama_path llama-7b \
--instruction "Name the top cities in France that should not be missed. Include the best aspects of each place as well."
接下来就是考验服务器内存的时候了