当前位置:   article > 正文

完整跑通Learning to Compress Prompts with Gist Tokens代码问题记录

learning to compress prompts with gist tokens

论文链接: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
  • 1

(2)卸载当前pydantic

pip uninstall pydantic
  • 1

(3)安装新的pydantic

 pip install pydantic==1.10.9
  • 1

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."
  • 1
  • 2

接下来就是考验服务器内存的时候了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/614853
推荐阅读
相关标签
  

闽ICP备14008679号