fastchat-t5-3b-v1.0 模型无法本地运行,
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.5k
- Forks
- 4.8k
- PR merge metrics
- No merged PRs in 30d
Description
下载项目,下载依赖, 都是正常
首次运行项目: python3 -m fastchat.serve.cli --model-path lmsys/fastchat-t5-3b-v1.0 能正常运行, 文件缓存的目录: ~/.cache/huggingface/hub/models--lmsys--fastchat-t5-3b-v1.0
但是通过网页下载模型: https://huggingface.co/lmsys/fastchat-t5-3b-v1.0/tree/main 到vicuna_data目录,通过python3 -m fastchat.serve.cli --model-path vicuna_data/fastchat-t5-3b-v1.0 无法正常运行,
甚至将本地缓存的文件~/.cache/huggingface/hub/models--lmsys--fastchat-t5-3b-v1.0 一对一复制到vicuna_data/fastchat-t5-3b-v1.0目录也无法运行, 报错如下
Traceback (most recent call last):
File "/root/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/root/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/root/gpt/FastChat/fastchat/serve/cli.py", line 234, in
main(args)
File "/root/gpt/FastChat/fastchat/serve/cli.py", line 176, in main
chat_loop(
File "/root/gpt/FastChat/fastchat/serve/inference.py", line 261, in chat_loop
model, tokenizer = load_model(
File "/root/gpt/FastChat/fastchat/model/model_adapter.py", line 201, in load_model
model, tokenizer = adapter.load_model(model_path, kwargs)
File "/root/gpt/FastChat/fastchat/model/model_adapter.py", line 341, in load_model
tokenizer = AutoTokenizer.from_pretrained(
File "/root/anaconda3/lib/python3.9/site-packages/transformers/models/auto/tokenization_auto.py", line 702, in from_pretrained
return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
File "/root/anaconda3/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 1811, in from_pretrained
return cls._from_pretrained(
File "/root/anaconda3/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 1965, in _from_pretrained
tokenizer = cls(*init_inputs, **init_kwargs)
File "/root/anaconda3/lib/python3.9/site-packages/transformers/models/t5/tokenization_t5.py", line 154, in __init__
self.sp_model.Load(vocab_file)
File "/root/anaconda3/lib/python3.9/site-packages/sentencepiece/__init__.py", line 905, in Load
return self.LoadFromFile(model_file)
File "/root/anaconda3/lib/python3.9/site-packages/sentencepiece/__init__.py", line 310, in LoadFromFile
return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg)
RuntimeError: Internal: src/sentencepiece_processor.cc(1101) [model_proto->ParseFromArray(serialized.data(), serialized.size())]
还有其他地方需要设置吗? 或者文件没下载完整?
PS: 按照官网示例: python3 -m fastchat.serve.cli --model-path lmsys/vicuna-7b-v1.3 下载vicuna-7b-v1.3模型到本地一样报错, 有谁遇到同样问题吗?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at fastchat/serve/cli.py and follow the call through fastchat/serve/inference.py into fastchat/model/model_adapter.py, where AutoTokenizer loads the local model. Compare the locally downloaded files with the cached model and inspect the SentencePiece tokenizer error. Done means the reported local model paths load successfully through the CLI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100