当前位置: 首页 > news >正文

模型加载常见问题

safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge

问题代码:

model = AutoModelForVision2Seq.from_pretrained(
    "/data-nvme/yang/Qwen2.5-VL-32B-Instruct",
    trust_remote_code=True,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    max_memory={i: '24GiB' for i in range(2)}
)

解决办法:

使用Git LFS完整克隆

cd /data-nvme/yang/
git lfs install
git clone https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct 
cd /data-nvme/yang/Qwen2.5-VL-7B-Instruct
git lfs pull --include="*.safetensors,*.json,*.py"

使用huggingface模型对应的调试代码,调试通过;

样例图片地址:

https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg

调色代码输出:

['这张图片展示了一位女士和一只狗在海滩上互动的场景。女士坐在沙滩上,穿着格子衬衫和牛仔裤,面带微笑,与狗进行握手。狗戴着彩色的项圈,看起来非常友好。背景是平静的海浪和渐变的天空,阳光洒在沙滩上,营造出一种温馨和谐的氛围。']

http://www.xdnf.cn/news/55.html

相关文章:

  • C/C++指针
  • 四大wordpress模板站
  • 第十七届“华中杯”大学生数学建模挑战赛题目A题 晶硅片产销策略优化 完整成品 代码 模型 思路 分享