当前位置: 首页> 科技> IT业 > 厦门建网站公司_如何免费开网店步骤_网站点击率查询_快排seo

厦门建网站公司_如何免费开网店步骤_网站点击率查询_快排seo

时间:2025/9/5 15:29:31来源:https://blog.csdn.net/qq_52788787/article/details/145952769 浏览次数:3次
厦门建网站公司_如何免费开网店步骤_网站点击率查询_快排seo

最近需要手动从huggingface上下载模型,尝试在调用模型时发现了不少问题,写个blogger记录一下,后续再行补充

1,下载meta-llama/Llama-3.2-3B到本地(推荐手动下载)

2,在下载到本地后,利用conda创建一个环境,并下载需要的包

conda create -n llm python==3.10
conda activate llm
pip install transformer

pytorch 根据自己的cuda版本选择合适的版本

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

3,写一个run.py脚本来调用,查看模型的结构

from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("/data/Matrix/zh/Llama-3.2-3B", trust_remote_code=True)
model = AutoModel.from_pretrained("/data/Matrix/zh/Llama-3.2-3B", trust_remote_code=True).half().cuda()
print(model)

可能出现的问题:

 ValueError: `rope_scaling` must be a dictionary with with two fields, `type` and `factor`, got {'factor': 32.0, 'high_freq_factor': 4.0, 'low_freq_factor': 1.0, 'original_max_position_embeddings': 8192, 'rope_type': 'llama3'}               解决办法:更新最新的transformer

pip install --upgrade transformers

最后就能看到模型的结构啦!

关键字:厦门建网站公司_如何免费开网店步骤_网站点击率查询_快排seo

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: