lm-sys / lm-sys/FastChat

ValueError: Tokenizer class QWenTokenizer does not exist or is not currently imported.

Open
#2,487 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
39.5k
Forks
4.8k
PR merge metrics
No merged PRs in 30d

Description

```log
~/repo/FastChat$ python -m fastchat.serve.model_worker --model-path ~/repo/models/Qwen-14B-Chat-Int4 --gptq-wbits 4 --gptq-groupsize 128 --model-names gpt-3.5-turbo
2023-09-28 14:36:05 | INFO | model_worker | args: Namespace(host='localhost', port=21002, worker_address='http://localhost:21002', controller_address='http://localhost:21001', model_path='~/repo/models/Qwen-14B-Chat-Int4', revision='main', device='cuda', gpus=None, num_gpus=1, max_gpu_memory=None, dtype=None, load_8bit=False, cpu_offloading=False, gptq_ckpt=None, gptq_wbits=4, gptq_groupsize=128, gptq_act_order=False, awq_ckpt=None, awq_wbits=16, awq_groupsize=-1, model_names=['gpt-3.5-turbo'], conv_template=None, embed_in_truncate=False, limit_worker_concurrency=5, stream_interval=2, no_register=False, seed=None)
2023-09-28 14:36:05 | INFO | model_worker | Loading the model ['gpt-3.5-turbo'] on worker c50b312b ...
2023-09-28 14:36:05 | INFO | stdout | Loading GPTQ quantized model...
2023-09-28 14:36:05 | ERROR | stderr | Traceback (most recent call last):
2023-09-28 14:36:05 | ERROR | stderr | File "", line 198, in _run_module_as_main
2023-09-28 14:36:05 | ERROR | stderr | File "", line 88, in _run_code
2023-09-28 14:36:05 | ERROR | stderr | File "~/repo/FastChat/fastchat/serve/model_worker.py", line 543, in
2023-09-28 14:36:05 | ERROR | stderr | args, worker = create_model_worker()
2023-09-28 14:36:05 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^
2023-09-28 14:36:05 | ERROR | stderr | File "~/repo/FastChat/fastchat/serve/model_worker.py", line 518, in create_model_worker
2023-09-28 14:36:05 | ERROR | stderr | worker = ModelWorker(
2023-09-28 14:36:05 | ERROR | stderr | ^^^^^^^^^^^^
2023-09-28 14:36:05 | ERROR | stderr | File "~/repo/FastChat/fastchat/serve/model_worker.py", line 221, in __init__
2023-09-28 14:36:05 | ERROR | stderr | self.model, self.tokenizer = load_model(
2023-09-28 14:36:05 | ERROR | stderr | ^^^^^^^^^^^
2023-09-28 14:36:05 | ERROR | stderr | File "~/repo/FastChat/fastchat/model/model_adapter.py", line 269, in load_model
2023-09-28 14:36:05 | ERROR | stderr | model, tokenizer = load_gptq_quantized(model_path, gptq_config)
2023-09-28 14:36:05 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-09-28 14:36:05 | ERROR | stderr | File "~/repo/FastChat/fastchat/modules/gptq.py", line 43, in load_gptq_quantized
2023-09-28 14:36:05 | ERROR | stderr | tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
2023-09-28 14:36:05 | ERROR | stderr | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-09-28 14:36:05 | ERROR | stderr | File "~/miniconda3/lib/python3.11/site-packages/transformers/models/auto/tokenization_auto.py", line 724, in from_pretrained
2023-09-28 14:36:05 | ERROR | stderr | raise ValueError(
2023-09-28 14:36:05 | ERROR | stderr | ValueError: Tokenizer class QWenTokenizer does not exist or is not currently imported.
```
我已经在服务器上安装了Qwen模型,用Qwen自己的脚本可以启动:
```bash
# cd to ~/repo/Qwen
python openai_api.py -c ~/repo/models/Qwen-14B-Chat-Int4 --server-name 0.0.0.0 --server-port 4000
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at fastchat/modules/gptq.py line 43, where AutoTokenizer.from_pretrained fails, and trace how fastchat/model/model_adapter.py invokes the GPTQ loader. Reproduce the model_worker command from the report and compare it with the working Qwen openai_api.py command. Done means the Qwen GPTQ model starts through FastChat without the tokenizer error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.