Repository: open-compass/opencompass
Issue: [Help] Load Local QWen model Error
Root cause: Configuration Error

### 先决条件

- [X] 我已经搜索过 [问题](https://github.com/InternLM/opencompass/issues/) 和 [讨论](https://github.com/InternLM/opencompass/discussions) 但未得到预期的帮助。
- [X] 错误在 [最新版本](https://github.com/InternLM/opencompass) 中尚未被修复。

### 问题类型

我正在使用官方支持的任务/模型/数据集进行评估。

### 环境

同官方

### 重现问题 - 代码/配置示例

```
from mmengine.config import read_base

with read_base():
    from .datasets.winograd.winograd_ppl import winograd_datasets
    from .datasets.siqa.siqa_gen import siqa_datasets

datasets = [*siqa_datasets, *winograd_datasets]

from opencompass.models import HuggingFaceCausalLM

# OPT-350M
opt350m = dict(
       type=HuggingFaceCausalLM,
       # the folowing are HuggingFaceCausalLM init parameters
       path='facebook/opt-350m',
       tokenizer_path='facebook/opt-350m',
       tokenizer_kwargs=dict(
           padding_side='left',
           truncation_side='left',
           proxies=None,
           trust_remote_code=True),
       model_kwargs=dict(device_map='auto'),
       max_seq_len=2048,
       # the folowing are not HuggingFaceCausalLM init parameters
       abbr='opt350m',                    # Model abbreviation
       max_out_len=100,                   # Maximum number of generated tokens          
       batch_size=1,
       run_cfg=dict(num_gpus=1),    # Run configuration for specifying resource requirements
    )

# # OPT-125M
# opt125m = dict(
#        type=HuggingFaceCausalLM,
#        # the folowing are HuggingFaceCausalLM init parameters
#        path='facebook/opt-125m',
#        tokenizer_path='facebook/opt-125m',
#        tokenizer_kwargs=dict(
#            padding_side='left',
#            truncation_side='left',
#            proxies=None,
#            trust_remote_code=True),
#        model_kwargs=dict(device_map='auto'),
#        max_seq_len=2048,
#        # the folowing are not HuggingFaceCausalLM init parameters
#        abbr='opt125m',                # Model abbreviation
#        max_out_len=100,               # Maximum number of generated tokens
#        batch_size=128,
#        run_cfg=dict(num_gpus=1),   # Run configuration for specifying resource requirements
#     )

qwen7b = dict(
       type=HuggingFaceCausalLM,
       # the folowing are HuggingFaceCausalLM init parameters
       path='/mnt/workspace/llm/model/manual/qwen/Qwen-7B-Chat',
       tokenizer_path='/mnt/workspace/llm/model/manual/qwen/Qwen-7B-Chat',
       tokenizer_kwargs=dict(
           padding_side='left',
           truncation_side='left',
           proxies=None,
           pad_token="
",
           trust_remote_code=True,
           ),
       model_kwargs=dict(device_map='auto'),
       max_seq_len=2048,
       # the folowing are not HuggingFaceCausalLM init parameters
       abbr='qwen7b',                # Model abbreviation
       max_out_len=1024,               # Maximum number of generated tokens
       batch_size=4,
       run_cfg=dict(num_gpus=1),   # Run configuration for specifying resource requirements
    )

models = [ qwen7b]
```
### 重现问题 - 命令或脚本

同官方demo

### 重现问题 - 错误信息

```
08/17 15:28:29 - OpenCompass - INFO - Task [qwen7b/siqa_0]
/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/mmengine/utils/manager.py:113: UserWarning: <class 'mmengine.logging.logger.MMLogger'> instance named of OpenCompass has been created, the method `get_instance` should not accept any other arguments
  warnings.warn(
Loading /mnt/workspace/llm/model/manual/qwen/Qwen-7B-Chat requires to execute some code in that repo, you can inspect the content of the repository at https://hf.co//mnt/workspace/llm/model/manual/qwen/Qwen-7B-Chat. You can dismiss this prompt by passing `trust_remote_code=True`.
Do you accept? [y/N] Traceback (most recent call last):
  File "/mnt/workspace/project/opencompass/opencompass/tasks/openicl_infer.py", line 147, in <module>
    inferencer.run()
  File "/mnt/workspace/project/opencompass/opencompass/tasks/openicl_infer.py", line 60, in run
    self.model = build_model_from_cfg(model_cfg)
  File "/mnt/workspace/project/opencompass/opencompass/utils/build.py", line 22, in build_model_from_cfg
    return MODELS.build(model_cfg)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/mmengine/registry/registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
  File "/mnt/workspace/project/opencompass/opencompass/models/huggingface.py", line 78, in __init__
    self._load_model(path=path,
  File "/mnt/workspace/project/opencompass/opencompass/models/huggingface.py", line 363, in _load_model
    self.model = AutoModelForCausalLM.from_pretrained(path, **model_kwargs)
  File "/mnt/workspace/project/opencompass/opencompass/utils/fileio.py", line 162, in auto_pt
    res = ori_auto_pt.__func__(cls, pretrained_model_name_or_path,
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 461, in from_pretrained
    config, kwargs = AutoConfig.from_pretrained(
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/transformers/models/auto/configuration_auto.py", line 986, in from_pretrained
    trust_remote_code = resolve_trust_remote_code(
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/transformers/dynamic_module_utils.py", line 538, in resolve_trust_remote_code
    answer = input(
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/transformers/dynamic_module_utils.py", line 520, in _raise_timeout_error
    raise ValueError(
ValueError: Loading this model requires you to execute the configuration file in that repo on your local machine. We asked if it was okay but did not get an answer. Make sure you have read the code there to avoid malicious use, then set the option `trust_remote_code=True` to remove this error.
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 18178) of binary: /mnt/workspace/opt/anaconda3/bin/python
Traceback (most recent call last):
  File "/mnt/workspace/opt/anaconda3/bin/torchrun", line 8, in <module>
    sys.exit(main())
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper
    return f(*args, **kwargs)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/run.py", line 794, in main
    run(args)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/run.py", line 785, in run
    elastic_launch(
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 134, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 250, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError: 
============================================================
/mnt/workspace/project/opencompass/opencompass/tasks/openicl_infer.py FAILED
------------------------------------------------------------
Failures:
  <NO_OTHER_FAILURES>
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2023-08-17_15:28:46
  host      : dsw53286-685954bd4b-nd5fv
  rank      : 0 (local_rank: 0)
  exitcode  : 1 (pid: 18178)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================
```

### 其他信息

我想读取本地的下载的qwen>好像不太行。

```python
from mmengine.config import read_base

with read_base():
    from .datasets.winograd.winograd_ppl import winograd_datasets
    from .datasets.siqa.siqa_gen import siqa_datasets

datasets = [*siqa_datasets, *winograd_datasets]

from opencompass.models import HuggingFaceCausalLM


qwen7b = dict(
       type=HuggingFaceCausalLM,
       # the folowing are HuggingFaceCausalLM init parameters
    #    path='/mnt/workspace/llm/model/manual/qwen/Qwen-7B-Chat',
    #    tokenizer_path='/mnt/workspace/llm/model/manual/qwen/Qwen-7B-Chat',
       path='Qwen/Qwen-7B-Chat',
       tokenizer_path='Qwen/Qwen-7B-Chat',
       tokenizer_kwargs=dict(
           padding_side='left',
           truncation_side='left',
           proxies=None,
           pad_token="
",
           trust_remote_code=True,
           ),
       model_kwargs=dict(device_map='auto'),
       max_seq_len=2048,
       # the folowing are not HuggingFaceCausalLM init parameters
       abbr='qwen7b',                # Model abbreviation
       max_out_len=1024,               # Maximum number of generated tokens
       batch_size=4,
       run_cfg=dict(num_gpus=1),   # Run configuration for specifying resource requirements
    )

models = [ qwen7b]
```

即使这么写也不太行。
```
       path='Qwen/Qwen-7B-Chat',
       tokenizer_path='Qwen/Qwen-7B-Chat',
```





```text
08/17 15:35:26 - OpenCompass - INFO - Task [qwen7b/siqa_1]
/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/mmengine/utils/manager.py:113: UserWarning: <class 'mmengine.logging.logger.MMLogger'> instance named of OpenCompass has been created, the method `get_instance` should not accept any other arguments
  warnings.warn(
Loading Qwen/Qwen-7B-Chat requires to execute some code in that repo, you can inspect the content of the repository at https://hf.co/Qwen/Qwen-7B-Chat. You can dismiss this prompt by passing `trust_remote_code=True`.
Do you accept? [y/N] Traceback (most recent call last):
  File "/mnt/workspace/project/opencompass/opencompass/tasks/openicl_infer.py", line 147, in <module>
    inferencer.run()
  File "/mnt/workspace/project/opencompass/opencompass/tasks/openicl_infer.py", line 60, in run
    self.model = build_model_from_cfg(model_cfg)
  File "/mnt/workspace/project/opencompass/opencompass/utils/build.py", line 22, in build_model_from_cfg
    return MODELS.build(model_cfg)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/mmengine/registry/registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
  File "/mnt/workspace/project/opencompass/opencompass/models/huggingface.py", line 78, in __init__
    self._load_model(path=path,
  File "/mnt/workspace/project/opencompass/opencompass/models/huggingface.py", line 363, in _load_model
    self.model = AutoModelForCausalLM.from_pretrained(path, **model_kwargs)
  File "/mnt/workspace/project/opencompass/opencompass/utils/fileio.py", line 162, in auto_pt
    res = ori_auto_pt.__func__(cls, pretrained_model_name_or_path,
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 461, in from_pretrained
    config, kwargs = AutoConfig.from_pretrained(
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/transformers/models/auto/configuration_auto.py", line 986, in from_pretrained
    trust_remote_code = resolve_trust_remote_code(
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/transformers/dynamic_module_utils.py", line 538, in resolve_trust_remote_code
    answer = input(
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/transformers/dynamic_module_utils.py", line 520, in _raise_timeout_error
    raise ValueError(
ValueError: Loading this model requires you to execute the configuration file in that repo on your local machine. We asked if it was okay but did not get an answer. Make sure you have read the code there to avoid malicious use, then set the option `trust_remote_code=True` to remove this error.
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 19381) of binary: /mnt/workspace/opt/anaconda3/bin/python
Traceback (most recent call last):
  File "/mnt/workspace/opt/anaconda3/bin/torchrun", line 8, in <module>
    sys.exit(main())
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper
    return f(*args, **kwargs)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/run.py", line 794, in main
    run(args)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/run.py", line 785, in run
    elastic_launch(
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 134, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 250, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError: 
============================================================
/mnt/workspace/project/opencompass/opencompass/tasks/openicl_infer.py FAILED
------------------------------------------------------------


Failures:
  <NO_OTHER_FAILURES>
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2023-08-17_15:35:46
  host      : dsw53286-685954bd4b-nd5fv
  rank      : 0 (local_rank: 0)
  exitcode  : 1 (pid: 19381)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================
```

> ValueError: Loading this model requires you to execute the configuration file in that repo on your local machine. We asked if it was okay but did not get an answer. Make sure you have read the code there to avoid malicious use, then set the option trust_remote_code=True to remove this error.

try it


试了，不行 好像找不到tokenizer   Tokenizer class QWenTokenizer does not exist or is not currently imported.
qwen目前支持不行吗

```
`08/17 15:39:49 - OpenCompass - INFO - Task [qwen7b/siqa_1]
/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/mmengine/utils/manager.py:113: UserWarning: <class 'mmengine.logging.logger.MMLogger'> instance named of OpenCompass has been created, the method `get_instance` should not accept any other arguments
  warnings.warn(
Traceback (most recent call last):
  File "/mnt/workspace/project/opencompass/opencompass/tasks/openicl_infer.py", line 147, in <module>
    inferencer.run()
  File "/mnt/workspace/project/opencompass/opencompass/tasks/openicl_infer.py", line 60, in run
    self.model = build_model_from_cfg(model_cfg)
  File "/mnt/workspace/project/opencompass/opencompass/utils/build.py", line 22, in build_model_from_cfg
    return MODELS.build(model_cfg)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/mmengine/registry/registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
  File "/mnt/workspace/project/opencompass/opencompass/models/huggingface.py", line 72, in __init__
    self._load_tokenizer(path=path,
  File "/mnt/workspace/project/opencompass/opencompass/models/huggingface.py", line 85, in _load_tokenizer
    self.tokenizer = AutoTokenizer.from_pretrained(
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/transformers/models/auto/tokenization_auto.py", line 699, in from_pretrained
    raise ValueError(
ValueError: Tokenizer class QWenTokenizer does not exist or is not currently imported.
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 20096) of binary: /mnt/workspace/opt/anaconda3/bin/python
Traceback (most recent call last):
  File "/mnt/workspace/opt/anaconda3/bin/torchrun", line 8, in <module>
    sys.exit(main())
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper
    return f(*args, **kwargs)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/run.py", line 794, in main
    run(args)
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/run.py", line 785, in run
    elastic_launch(
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 134, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
  File "/mnt/workspace/opt/anaconda3/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 250, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError: 
============================================================
/mnt/workspace/project/opencompass/opencompass/tasks/openicl_infer.py FAILED
------------------------------------------------------------
Failures:
  <NO_OTHER_FAILURES>
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2023-08-17_15:39:56
  host      : dsw53286-685954bd4b-nd5fv
  rank      : 0 (local_rank: 0)
  exitcode  : 1 (pid: 20096)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================
`
```

`
qwen7b = dict(
       type=HuggingFaceCausalLM,
       # the folowing are HuggingFaceCausalLM init parameters
    #    path='/mnt/workspace/llm/model/manual/qwen/Qwen-7B-Chat',
    #    tokenizer_path='/mnt/workspace/llm/model/manual/qwen/Qwen-7B-Chat',
       path='Qwen/Qwen-7B',
       tokenizer_path='Qwen/Qwen-7B',
       tokenizer_kwargs=dict(
           padding_side='left',
           truncation_side='left',
           proxies=None,
           pad_token="
",
        #    trust_remote_code=True,
           ),
       model_kwargs=dict(device_map='auto'),
       max_seq_len=2048,
       # the folowing are not HuggingFaceCausalLM init parameters
       abbr='qwen7b',                # Model abbreviation
       max_out_len=1024,               # Maximum number of generated tokens
       batch_size=4,
       run_cfg=dict(num_gpus=1),   # Run configuration for specifying resource requirements
    )

models = [ qwen7b]`

我这么写可以么

我最近都是基于qwen做的，想用你们这个评测，

我不确定你们本地是什么？你有尝试使用huggingface API 直接使用本地模型吗？
https://github.com/QwenLM/Qwen-7B/tree/c3c61a14b7f268c60b662a09a6379a08200f8cb8#-transformers


本地就是从hg下载的模型，不过这两种写的方法都不行。
```
# path='/mnt/workspace/llm/model/manual/qwen/Qwen-7B-Chat',
# tokenizer_path='/mnt/workspace/llm/model/manual/qwen/Qwen-7B-Chat',
```
```
path='Qwen/Qwen-7B',
tokenizer_path='Qwen/Qwen-7B',
```

你可以不设置本地模型路径，让它直接下载到  ``` ~/.cache/huggingface/hub```

path='Qwen/Qwen-7B',
tokenizer_path='Qwen/Qwen-7B',  这么写也不行。

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

我看主分支并没有qwen的demo，或者这边有写好的么。抄作业。

Here is my configs

`configs/models/hf_qwen_7b.py`

```python
from opencompass.models import HuggingFaceCausalLM


models = [
    dict(
        type=HuggingFaceCausalLM,
        abbr='qwen-7b-hf',
        path="Qwen/Qwen-7B",
        tokenizer_path='Qwen/Qwen-7B',
        tokenizer_kwargs=dict(
            padding_side='left',
            truncation_side='left',
            trust_remote_code=True,
            use_fast=False,
            revision='39fc5fdcb95c8c367bbdb3bfc0db71d96266de09',
            cache_dir="/path/to/.cache/huggingface/hub", # change me
        ),
        max_out_len=100,
        max_seq_len=2048,
        batch_size=8,
        model_kwargs=dict(
            device_map='auto',
            trust_remote_code=True,
            revision='39fc5fdcb95c8c367bbdb3bfc0db71d96266de09',
            cache_dir="/path/to/.cache/huggingface/hub", # change me
        ),
        run_cfg=dict(num_gpus=1, num_procs=1),
    )
]
```


`configs/models/hf_qwen_7b_chat.py`

```python
from opencompass.models import HuggingFaceCausalLM


_meta_template = dict(
    round=[
        dict(role="HUMAN", begin='\n
user\n', end='
'),
        dict(role="BOT", begin="\n
assistant\n", end='
', generate=True),
    ],
)

models = [
    dict(
        type=HuggingFaceCausalLM,
        abbr='qwen-7b-chat-hf',
        path="Qwen/Qwen-7B-Chat",
        tokenizer_path='Qwen/Qwen-7B-Chat',
        tokenizer_kwargs=dict(
            padding_side='left',
            truncation_side='left',
            trust_remote_code=True,
            use_fast=False,
            cache_dir="/path/to/.cache/huggingface/hub", # change me
        ),
        max_out_len=100,
        max_seq_len=2048,
        batch_size=8,
        meta_template=_meta_template,
        model_kwargs=dict(
            device_map='auto', 
            trust_remote_code=True,
            cache_dir="/path/to/.cache/huggingface/hub", # change me
        ),
        run_cfg=dict(num_gpus=1, num_procs=1),
    )
]
```

`/path/to/.cache/huggingface/hub` folder looks like：

```text
tree /path/to/.cache/huggingface/hub
├── models--Qwen--Qwen-7B
│   ├── blobs
│   │   ├── 1a9ea1b3a9ee6f37eed063e3e5c644353309cf94bc56982828c5a6d9928a3cd4
│   │   ├── 2524b0f63b9d29bd9d90104a1fdccbf6c2dcb273e04425c9b5b6f1cf0e992fd8
│   │   ├── 25659f0ae35e9c8728e8f8d9c2e6100824925542
│   │   ├── 25cbc065a931a8793a1e4b7a7bbec3d2100a0d25
│   │   ├── 2cc1bb2883740aa748acd9cee2d855290a1f93b13461fa73b7b8e5531a32ab7f
│   │   ├── 370e82ae3976e8b89092982ce2b70a79fecce5df
│   │   ├── 4a66a09add2c3e40714b713aeffa39dfc8314863
│   │   ├── 4e8e1d8cadcb50ee9dffecc629d368371d268e88
│   │   ├── 502ef6c98e82b6b9beae4a047adecc2f9c481778
│   │   ├── 5fd359c60a4f2ec60a5485ffac6cde5da4e398a8
│   │   ├── 712ab99bd5979e5571f270bf7552fc2368ea9031
│   │   ├── 7361b298a82b284129276f586dec570b5d41259130d190960321cc0db92d958f
│   │   ├── 7745c0eaee03bce032fce81490cfa4e334fa59bdbf14840db184bddcd3b86a35
│   │   ├── 9015cd37beae7c2bf1c6b7179dd9ecf9c028165a
│   │   ├── 9b9b0e0416d84d7c88333eb261c77e5fe2d7f7be
│   │   ├── 9c37cacbcfbb909b4ed2b928c969633a4f84b348
│   │   ├── a034fa933cccbd9cb46aefd25681212b3e42587f
│   │   ├── a84dfb7d7afd3f6fb93f65d50550481f1d84a395
│   │   ├── be9fc9fd671dd29258478946724308e1f63c3fbf18c689294b46532ccf0515db
│   │   ├── c843043d878110d4e2e3259da5e66f69210a22b6
│   │   ├── cc587466cf78a7984cf486661e45b23d6cf6e6c1
│   │   ├── ced11d31cc1cba12973fa92fd6450a1700767d2ae5c730be909f70abcca946a8
│   │   ├── e995e6f9502910e1f1dbf109df6b6a7db3733cd9adccd2d408e2f3a0d5549900
│   │   ├── f46c56789137dbcd6920b7887cd639648934cf0442bc587fc05a8f7afbb02ada
│   │   └── f599770ba087c8900b62d752ba37b0e706173926
│   ├── refs
│   │   └── main
│   └── snapshots
│       ├── 040534f3e4ee42bcefdf901606484c61c764054a
│       ├── 20256d6e9e3fd32c26e7084660bb469fa6456aa5
│       └── 39fc5fdcb95c8c367bbdb3bfc0db71d96266de09
├── models--Qwen--Qwen-7B-Chat
│   ├── blobs
│   │   ├── 65e2017da1447113834c8970681d96439d11616c
│   │   ├── 88e4b67b0b4794fe76e0cd502b8ec2a7c7f214c8
│   │   ├── 9b9b0e0416d84d7c88333eb261c77e5fe2d7f7be
│   │   ├── a84dfb7d7afd3f6fb93f65d50550481f1d84a395
│   │   ├── c52355c65942ef1c18f8ac9e9f078116aa62912bf146bc16b34ed9bb546f044f
│   │   ├── c843043d878110d4e2e3259da5e66f69210a22b6
│   │   ├── eb4923e8bf5f805ce0ca42f8872d2143ea9cec46
│   │   ├── f599770ba087c8900b62d752ba37b0e706173926
│   │   └── fca91a54ea166742eec7fc130f0f91ba318c0542
│   ├── refs
│   │   └── main
│   └── snapshots
│       └── 9882935f67aa557461dad47379b0788d68380369
....
```

`configs/run_qwen_7b.py`

```python
from mmengine.config import read_base

with read_base():
    from .datasets.collections.base_medium_llama import datasets

    from .models.hf_qwen_7b import models as qwen_7b_model
    from .models.hf_qwen_7b_chat import models as qwen_7b_chat_model

    from .summarizers.medium import summarizer

models = sum([v for k, v in locals().items() if k.endswith("_model")], [])
```

my dependency is 

```
tokenizers==0.13.3
transformers==4.31.0
```

> 

按照你说的操作， 对于Qwen-chat-7B ,会产生如下错误：
ValueError: Encountered text corresponding to disallowed special token '
'.

all my local models had same issue, did you solve it?

> all my local models had same issue, did you solve it?

在huggingface.py文件里增加“, trust_remote_code=True”， 以及安装pip install transformers_stream_generator