Open li1553770945 opened 3 months ago
在llm/pytorch/compression.py:133
中,有如下代码:
if os.path.exists(model_path):
# `model_path` is a local folder
base_pattern = os.path.join(model_path, "pytorch_model*.bin")
else:
# `model_path` is a cached Hugging Face repo
model_path = snapshot_download(model_path, revision=revision)
base_pattern = os.path.join(model_path, "pytorch_model*.bin")
可以看出试图加载的模型必须名字叫做pytorch_model*.bin
。但是实际查看model_path,对于qwen1.5-moe-chat模型而言,其实际保存的文件格式是safetensors,因此导致了模型加载失败。
可以尝试修复吗?
遇到了相同的问题,没有一个人能解决吗
我跑下来一切正常。
Name: transformers
Version: 4.43.2
Name: bitsandbytes
Version: 0.43.0
这两个库看下对齐是否正常。
我跑下来一切正常。
Name: transformers Version: 4.43.2
Name: bitsandbytes Version: 0.43.0
这两个库看下对齐是否正常。
你下载的模型文件是什么样的呢,我下载下来都是一些safetensor格式的,但是我用的那个版本的xinference加载模型的时候只能加载bin,所以出现了这个问题。
我跑下来一切正常。
Name: transformers Version: 4.43.2
Name: bitsandbytes Version: 0.43.0
这两个库看下对齐是否正常。
你下载的模型文件是什么样的呢,我下载下来都是一些safetensor格式的,但是我用的那个版本的xinference加载模型的时候只能加载bin,所以出现了这个问题。
下载的pytorch模型都是safetensors格式,全部都不能成功加载
应该是quantization导致的,quantization选择none应该没问题
System Info / 系統信息
Python: Python 3.10.14
os:
Running Xinference with Docker? / 是否使用 Docker 运行 Xinfernece?
Version info / 版本信息
xinference, version 0.13.2
The command used to start Xinference / 用以启动 xinference 的命令
xinference-local --host 0.0.0.0 --port 9997
Reproduction / 复现过程
使用命令
xinference launch --model-engine Transformers --model-name qwen1.5-moe-chat --size-in-billions 2_7 --model-format pytorch --quantization 8-bit
,或者在网页ui上部署模型qwen1.5-moe-chat。Expected behavior / 期待表现
能够正常加载模型。
以下是完整报错traceback: