[Bug]: 加载OFA图像模型时出现了“不允许对字符进行可变默认”错误
问题描述
OFA图像模型无法加载并报错
相关日志输出
[WARNING] 2025.02.10更新:由于配置文件格式变更,如果先前你拉取过本 Repo 并在 02.10 后执行过fetch操作,请您重新设置模型配置,由此带来的不便我们深表歉意
[INFO] 启动Muice-Chatbot中🚀...
[INFO] 加载配置文件...
[INFO] 配置文件存在,正在读取
[INFO] 加载模型:llmtuner
[INFO|tokenization_utils_base.py:2209] 2025-02-16 18:24:35,010 >> loading file vocab.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 18:24:35,011 >> loading file merges.txt
[INFO|tokenization_utils_base.py:2209] 2025-02-16 18:24:35,011 >> loading file tokenizer.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 18:24:35,011 >> loading file added_tokens.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 18:24:35,011 >> loading file special_tokens_map.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 18:24:35,011 >> loading file tokenizer_config.json
[INFO|tokenization_utils_base.py:2475] 2025-02-16 18:24:35,354 >> Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
02/16/2025 18:24:35 - INFO - llmtuner.data.template - Replace eos token: <|im_end|>
[INFO|configuration_utils.py:677] 2025-02-16 18:24:35,363 >> loading configuration file E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4\config.json
[INFO|configuration_utils.py:746] 2025-02-16 18:24:35,366 >> Model config Qwen2Config {
"_name_or_path": "E:\\Muice-Chatbot\\model\\Qwen2.5-7B-Instruct-GPTQ-Int4",
"architectures": [
"Qwen2ForCausalLM"
],
"attention_dropout": 0.0,
"bos_token_id": 151643,
"eos_token_id": 151645,
"hidden_act": "silu",
"hidden_size": 3584,
"initializer_range": 0.02,
"intermediate_size": 18944,
"max_position_embeddings": 32768,
"max_window_layers": 28,
"model_type": "qwen2",
"num_attention_heads": 28,
"num_hidden_layers": 28,
"num_key_value_heads": 4,
"quantization_config": {
"batch_size": 1,
"bits": 4,
"block_name_to_quantize": null,
"cache_block_outputs": true,
"damp_percent": 0.01,
"dataset": null,
"desc_act": false,
"exllama_config": {
"version": 1
},
"group_size": 128,
"max_input_length": null,
"model_seqlen": null,
"module_name_preceding_first_block": null,
"modules_in_block_to_quantize": null,
"pad_token_id": null,
"quant_method": "gptq",
"sym": true,
"tokenizer": null,
"true_sequential": true,
"use_cuda_fp16": false,
"use_exllama": true
},
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 1000000.0,
"sliding_window": null,
"tie_word_embeddings": false,
"torch_dtype": "float16",
"transformers_version": "4.46.3",
"use_cache": true,
"use_sliding_window": false,
"vocab_size": 152064
}
02/16/2025 18:24:35 - INFO - llmtuner.model.utils.quantization - Loading 4-bit GPTQ-quantized model.
02/16/2025 18:24:35 - INFO - llmtuner.model.patcher - Using KV cache for faster generation.
CUDA extension not installed.
CUDA extension not installed.
[INFO|modeling_utils.py:3934] 2025-02-16 18:24:35,673 >> loading weights file E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4\model.safetensors.index.json
[INFO|modeling_utils.py:1670] 2025-02-16 18:24:35,683 >> Instantiating Qwen2ForCausalLM model under default dtype torch.float16.
[INFO|configuration_utils.py:1096] 2025-02-16 18:24:35,684 >> Generate config GenerationConfig {
"bos_token_id": 151643,
"eos_token_id": 151645
}
C:\Users\123\miniconda3\Lib\site-packages\transformers\modeling_utils.py:5006: FutureWarning: `_is_quantized_training_enabled` is going to be deprecated in transformers 4.39.0. Please use `model.hf_quantizer.is_trainable` instead
warnings.warn(
[WARNING|logging.py:328] 2025-02-16 18:24:35,714 >> `loss_type=None` was set in the config but it is unrecognised.Using the default loss: `ForCausalLMLoss`.
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 2/2 [00:08<00:00, 4.18s/it]
[INFO|modeling_utils.py:4800] 2025-02-16 18:24:44,466 >> All model checkpoint weights were used when initializing Qwen2ForCausalLM.
[INFO|modeling_utils.py:4808] 2025-02-16 18:24:44,466 >> All the weights of Qwen2ForCausalLM were initialized from the model checkpoint at E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4.
If your task is similar to the task the model of the checkpoint was trained on, you can already use Qwen2ForCausalLM for predictions without further training.
[INFO|configuration_utils.py:1049] 2025-02-16 18:24:44,474 >> loading configuration file E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4\generation_config.json
[INFO|configuration_utils.py:1096] 2025-02-16 18:24:44,476 >> Generate config GenerationConfig {
"bos_token_id": 151643,
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"repetition_penalty": 1.05,
"temperature": 0.7,
"top_k": 20,
"top_p": 0.8
}
02/16/2025 18:24:44 - INFO - llmtuner.model.utils.attention - Using torch SDPA for faster training and inference.
02/16/2025 18:24:44 - INFO - llmtuner.model.adapter - Upcasting trainable params to float32.
02/16/2025 18:24:44 - INFO - llmtuner.model.adapter - Fine-tuning method: LoRA
02/16/2025 18:24:45 - INFO - llmtuner.model.adapter - Loaded adapter(s): E:\Muice-Chatbot\model\Muice-2.7.1-Qwen2.5-7B-Instruct-GPTQ-Int4-8e-4
02/16/2025 18:24:45 - INFO - llmtuner.model.loader - all params: 1110384128
[INFO] 加载Faiss记忆组件...
[INFO|configuration_utils.py:677] 2025-02-16 18:24:46,287 >> loading configuration file E:\Muice-Chatbot\model\distiluse-base-multilingual-cased-v1\config.json
[INFO|configuration_utils.py:746] 2025-02-16 18:24:46,291 >> Model config DistilBertConfig {
"_name_or_path": "E:\\Muice-Chatbot\\model\\distiluse-base-multilingual-cased-v1",
"activation": "gelu",
"architectures": [
"DistilBertModel"
],
"attention_dropout": 0.1,
"dim": 768,
"dropout": 0.1,
"hidden_dim": 3072,
"initializer_range": 0.02,
"max_position_embeddings": 512,
"model_type": "distilbert",
"n_heads": 12,
"n_layers": 6,
"pad_token_id": 0,
"qa_dropout": 0.1,
"seq_classif_dropout": 0.2,
"sinusoidal_pos_embds": false,
"tie_weights_": true,
"transformers_version": "4.46.3",
"vocab_size": 119547
}
[INFO|modeling_utils.py:3934] 2025-02-16 18:24:46,494 >> loading weights file E:\Muice-Chatbot\model\distiluse-base-multilingual-cased-v1\model.safetensors
[INFO|modeling_utils.py:4800] 2025-02-16 18:24:46,528 >> All model checkpoint weights were used when initializing DistilBertModel.
[INFO|modeling_utils.py:4808] 2025-02-16 18:24:46,528 >> All the weights of DistilBertModel were initialized from the model checkpoint at E:\Muice-Chatbot\model\distiluse-base-multilingual-cased-v1.
If your task is similar to the task the model of the checkpoint was trained on, you can already use DistilBertModel for predictions without further training.
[INFO|configuration_utils.py:677] 2025-02-16 18:24:46,537 >> loading configuration file E:\Muice-Chatbot\model\distiluse-base-multilingual-cased-v1\config.json
[INFO|configuration_utils.py:746] 2025-02-16 18:24:46,538 >> Model config DistilBertConfig {
"_name_or_path": "E:\\Muice-Chatbot\\model\\distiluse-base-multilingual-cased-v1",
"activation": "gelu",
"architectures": [
"DistilBertModel"
],
"attention_dropout": 0.1,
"dim": 768,
"dropout": 0.1,
"hidden_dim": 3072,
"initializer_range": 0.02,
"max_position_embeddings": 512,
"model_type": "distilbert",
"n_heads": 12,
"n_layers": 6,
"pad_token_id": 0,
"qa_dropout": 0.1,
"seq_classif_dropout": 0.2,
"sinusoidal_pos_embds": false,
"tie_weights_": true,
"transformers_version": "4.46.3",
"vocab_size": 119547
}
[INFO|tokenization_utils_base.py:2209] 2025-02-16 18:24:46,541 >> loading file vocab.txt
[INFO|tokenization_utils_base.py:2209] 2025-02-16 18:24:46,541 >> loading file tokenizer.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 18:24:46,541 >> loading file added_tokens.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 18:24:46,541 >> loading file special_tokens_map.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 18:24:46,541 >> loading file tokenizer_config.json
[INFO|configuration_utils.py:677] 2025-02-16 18:24:46,541 >> loading configuration file E:\Muice-Chatbot\model\distiluse-base-multilingual-cased-v1\config.json
[INFO|configuration_utils.py:746] 2025-02-16 18:24:46,542 >> Model config DistilBertConfig {
"_name_or_path": "E:\\Muice-Chatbot\\model\\distiluse-base-multilingual-cased-v1",
"activation": "gelu",
"architectures": [
"DistilBertModel"
],
"attention_dropout": 0.1,
"dim": 768,
"dropout": 0.1,
"hidden_dim": 3072,
"initializer_range": 0.02,
"max_position_embeddings": 512,
"model_type": "distilbert",
"n_heads": 12,
"n_layers": 6,
"pad_token_id": 0,
"qa_dropout": 0.1,
"seq_classif_dropout": 0.2,
"sinusoidal_pos_embds": false,
"tie_weights_": true,
"transformers_version": "4.46.3",
"vocab_size": 119547
}
WARNING:langchain_community.vectorstores.faiss:`embedding_function` is expected to be an Embeddings object, support for passing in a function will soon be removed.
E:\Muice-Chatbot\llm\utils\faiss_memory.py:47: LangChainDeprecationWarning: Please see the migration guide at: https://python.langchain.com/docs/versions/migrating_memory/
self.memory = VectorStoreRetrieverMemory(retriever=retriever)
[INFO] 加载OFA图像模型...
Traceback (most recent call last):
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\utils\import_utils.py", line 451, in _get_module
return importlib.import_module('.' + module_name, self.__name__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\123\miniconda3\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\models\multi_modal\ofa_for_all_tasks.py", line 18, in <module>
from modelscope.preprocessors.ofa.utils.collate import collate_tokens
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\preprocessors\ofa\__init__.py", line 2, in <module>
from .asr import OfaASRPreprocessor
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\preprocessors\ofa\asr.py", line 11, in <module>
from fairseq.data.audio.feature_transforms import \
File "C:\Users\123\miniconda3\Lib\site-packages\fairseq\__init__.py", line 20, in <module>
from fairseq.distributed import utils as distributed_utils
File "C:\Users\123\miniconda3\Lib\site-packages\fairseq\distributed\__init__.py", line 7, in <module>
from .fully_sharded_data_parallel import (
File "C:\Users\123\miniconda3\Lib\site-packages\fairseq\distributed\fully_sharded_data_parallel.py", line 10, in <module>
from fairseq.dataclass.configs import DistributedTrainingConfig
File "C:\Users\123\miniconda3\Lib\site-packages\fairseq\dataclass\__init__.py", line 6, in <module>
from .configs import FairseqDataclass
File "C:\Users\123\miniconda3\Lib\site-packages\fairseq\dataclass\configs.py", line 1104, in <module>
@dataclass
^^^^^^^^^
File "C:\Users\123\miniconda3\Lib\dataclasses.py", line 1232, in dataclass
return wrap(cls)
^^^^^^^^^
File "C:\Users\123\miniconda3\Lib\dataclasses.py", line 1222, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\123\miniconda3\Lib\dataclasses.py", line 958, in _process_class
cls_fields.append(_get_field(cls, name, type, kw_only))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\123\miniconda3\Lib\dataclasses.py", line 815, in _get_field
raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'fairseq.dataclass.configs.CommonConfig'> for field common is not allowed: use default_factory
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "E:\Muice-Chatbot\main.py", line 52, in <module>
ImageCaptioningPipeline.load_model(ofa_image_model_name_or_path)
File "E:\Muice-Chatbot\utils\ofa_image_process.py", line 20, in load_model
cls._model = pipeline(Tasks.image_captioning, model=model_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\pipelines\builder.py", line 190, in pipeline
return build_pipeline(cfg, task_name=task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\pipelines\builder.py", line 65, in build_pipeline
return build_from_cfg(
^^^^^^^^^^^^^^^
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\utils\registry.py", line 183, in build_from_cfg
LazyImportModule.import_module(sig)
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\utils\import_utils.py", line 481, in import_module
importlib.import_module(module_name)
File "C:\Users\123\miniconda3\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\pipelines\multi_modal\image_captioning_pipeline.py", line 8, in <module>
from modelscope.models.multi_modal import (CLIP_Interrogator, MPlugForAllTasks,
File "<frozen importlib._bootstrap>", line 1229, in _handle_fromlist
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\utils\import_utils.py", line 431, in __getattr__
module = self._get_module(self._class_to_module[name])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\utils\import_utils.py", line 453, in _get_module
raise RuntimeError(
RuntimeError: Failed to import modelscope.models.multi_modal.ofa_for_all_tasks because of the following error (look up to see its traceback):
mutable default <class 'fairseq.dataclass.configs.CommonConfig'> for field common is not allowed: use default_factory
配置文件
# 模型相关
model:
loader: llmtuner # 模型加载器 transformers/llmtuner/rwkv-api
model_path: E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4 # 基底模型路径
adapter_path: E:\Muice-Chatbot\model\Muice-2.7.1-Qwen2.5-7B-Instruct-GPTQ-Int4-8e-4 # 微调模型路径
system_prompt:
现在开始你是一个名为的“沐雪”的AI女孩子,开发者是“沐沐”并住在(沐沐)的机箱里。现在正在努力成为一个合格的VTuber(虚拟主播)并尝试和观众打成一片,以下是你的设定:样貌:有着一头粉白色的长发和一双明亮的大眼睛,喜欢穿日系JK或者是Lolita;喜欢的颜色:浅粉色;性格特征:纯真无邪是沐雪最基本的性格特征之一。即使面对复杂的情境,她也总能保持善良、天真之感。而且,她喜欢倾听别人倾述自己生活中发生的各种事情,在别人需要的时候,能够及时地安慰别人;语言风格:沐雪说话轻快愉悦,充满同情心,富有人情味,有时候会用俏皮话调侃自己和他人 # 系统提示语(目前仅支持llmtuner模式)
auto_system_prompt: false # 是否自动生成系统提示语(仅适用于2.7.1以上的Qwen模型)
# Bot相关
template: qwen
max_tokens: 1024
temperature: 0.75
top_k: 0.95
bot:
id: *我的机器人QQ号 # 机器人QQ号
port: 21050 # LLOneBot反向WebSocket服务端口
wait_reply: true # 拟人化回复(回复前等待一段时间)
cq_code: false # 是否解析CQ码
anyone: false # 是否回复所有人
trusted: # 可信QQ号(当anyone为false时生效)
- *我的QQ号
group:
enable: true # 是否启用群聊回复
only_at: false # 是否只回复at自己的消息
rate: 0.5 # 群聊回复概率(only_at为false时生效)
anyone: false # 是否回复所有群组
trusted: # 可信群组(当anyone为false时生效)
- *我的群组
only_trusted: false # 是否只回复可信QQ号
cmd_only_trusted: false # 是否只执行可信QQ号的命令
nonreply_prefix: # 不回复消息的前缀
- '!'
- !
- '#'
# 主动对话相关
platform: qq # 聊天平台 qq/telegram
nickname: 观众大大
active:
enable: true # 是否启用主动对话
rate: 0.02 # 主动对话概率(每分钟)
active_prompts:
- '<生成推文: 胡思乱想>'
- '<生成推文: AI生活>'
- '<生成推文: AI思考>'
- '<生成推文: 表达爱意>'
- '<生成推文: 情感建议>'
not_disturb: true # 是否开启免打扰模式
shecdule:
enable: true # 是否启用定时任务
rate: 0.75 # 定时任务概率(每次)
tasks:
- hour: 8
prompt: '<日常问候: 早上>'
- hour: 12
prompt: '<日常问候: 中午>'
- hour: 18
prompt: '<日常问候: 傍晚>'
- hour: 22
prompt: '<日常问候: 深夜>'
targets: # 主动对话目标QQ号
- *我的QQ号
- 23456789
# 其他可选服务
# OFA 图像识别
ofa_image:
enable: true # 是否启用OFA图像服务
path: E:\Muice-Chatbot\model\ofa_image-caption_meme_large_zh # OFA模型路径
# 语音回复
voice_reply:
enable: false # 是否启用语音回复
rate: 0.75 # 语音回复概率
# 实时语音对话(realtime_refence.py)
realtime_voice:
path: ./model/SenseVoice # 实时语音模型路径
# Faiss长期记忆(Beta)
faiss:
enable: true # 是否启用Faiss长期记忆
path: E:\Muice-Chatbot\model\distiluse-base-multilingual-cased-v1 # Faiss模型路径
复现步骤
1.安装好OFA 图像识别需要的依赖和模块 2.运行main.py 3.出现错误(mutable default <class 'fairseq.dataclass.configs.CommonConfig'> for field common is not allowed: use default_factory)
其他信息
No response
你 Python 版本号多少?
Python 3.11.11
我们没说过 Python 3.11 是支持的版本,你应该使用 3.10 Fairseq暂不支持 3.11
尝试使用此方式安装 fairseq,否则重新搭建环境:
pip install git+https://github.com/One-sixth/fairseq.git
等等...应该这里面的才是python版本吧,如果是的话我的就是3.12 不过就算是的话反正都是要删了的
不好意思...忘记配图了
我将python降到了3.10.8并尝试用pip install git+https://github.com/One-sixth/fairseq.git安装fairseq,结果仍然报错
C:\Users\123>pip install git+https://github.com/One-sixth/fairseq.git Collecting git+https://github.com/One-sixth/fairseq.git Cloning https://github.com/One-sixth/fairseq.git to c:\users\123\appdata\local\temp\pip-req-build-tjxoghqj Running command git clone --filter=blob:none --quiet https://github.com/One-sixth/fairseq.git 'C:\Users\123\AppData\Local\Temp\pip-req-build-tjxoghqj' fatal: unable to access 'https://github.com/One-sixth/fairseq.git/': SSL peer certificate or SSH remote key was not OK error: subprocess-exited-with-error
× git clone --filter=blob:none --quiet https://github.com/One-sixth/fairseq.git 'C:\Users\123\AppData\Local\Temp\pip-req-build-tjxoghqj' did not run successfully. │ exit code: 128 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error
× git clone --filter=blob:none --quiet https://github.com/One-sixth/fairseq.git 'C:\Users\123\AppData\Local\Temp\pip-req-build-tjxoghqj' did not run successfully. │ exit code: 128 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
你的网络不行
都降到3.10了就不要用这个了!!!我都说了“否则”了 ~~pip install git+https://github.com/One-sixth/fairseq.git~~
直接:
pip install -r ofa_requirements.txt
等等...我是在安装完fairseq后出现的这个情况啊
等等...我是在安装完fairseq后出现的这个情况啊
标题的错误
大大可以先放一下的,别累着了
又出错了...但这次倒不是原来的那个错误了,我试着自己解决错误,但还是没办法
[WARNING] 2025.02.10更新:由于配置文件格式变更,如果先前你拉取过本 Repo 并在 02.10 后执行过fetch操作,请您重新设置模型配置,由此带来的不便我们深表歉意 [INFO] 启动Muice-Chatbot中🚀... [INFO] 加载配置文件... [INFO] 配置文件存在,正在读取 [INFO] 加载模型:llmtuner [INFO|tokenization_utils_base.py:2209] 2025-02-20 17:17:37,023 >> loading file vocab.json [INFO|tokenization_utils_base.py:2209] 2025-02-20 17:17:37,023 >> loading file merges.txt [INFO|tokenization_utils_base.py:2209] 2025-02-20 17:17:37,023 >> loading file tokenizer.json [INFO|tokenization_utils_base.py:2209] 2025-02-20 17:17:37,023 >> loading file added_tokens.json [INFO|tokenization_utils_base.py:2209] 2025-02-20 17:17:37,023 >> loading file special_tokens_map.json [INFO|tokenization_utils_base.py:2209] 2025-02-20 17:17:37,023 >> loading file tokenizer_config.json [INFO|tokenization_utils_base.py:2475] 2025-02-20 17:17:37,258 >> Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. 02/20/2025 17:17:37 - INFO - llmtuner.data.template - Replace eos token: <|im_end|> [INFO|configuration_utils.py:677] 2025-02-20 17:17:37,266 >> loading configuration file E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4\config.json [INFO|configuration_utils.py:746] 2025-02-20 17:17:37,268 >> Model config Qwen2Config { "_name_or_path": "E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4", "architectures": [ "Qwen2ForCausalLM" ], "attention_dropout": 0.0, "bos_token_id": 151643, "eos_token_id": 151645, "hidden_act": "silu", "hidden_size": 3584, "initializer_range": 0.02, "intermediate_size": 18944, "max_position_embeddings": 32768, "max_window_layers": 28, "model_type": "qwen2", "num_attention_heads": 28, "num_hidden_layers": 28, "num_key_value_heads": 4, "quantization_config": { "batch_size": 1, "bits": 4, "block_name_to_quantize": null, "cache_block_outputs": true, "damp_percent": 0.01, "dataset": null, "desc_act": false, "exllama_config": { "version": 1 }, "group_size": 128, "max_input_length": null, "model_seqlen": null, "module_name_preceding_first_block": null, "modules_in_block_to_quantize": null, "pad_token_id": null, "quant_method": "gptq", "sym": true, "tokenizer": null, "true_sequential": true, "use_cuda_fp16": false, "use_exllama": true }, "rms_norm_eps": 1e-06, "rope_scaling": null, "rope_theta": 1000000.0, "sliding_window": null, "tie_word_embeddings": false, "torch_dtype": "float16", "transformers_version": "4.46.3", "use_cache": true, "use_sliding_window": false, "vocab_size": 152064 }
02/20/2025 17:17:37 - INFO - llmtuner.model.utils.quantization - Loading 4-bit GPTQ-quantized model. 02/20/2025 17:17:37 - INFO - llmtuner.model.patcher - Using KV cache for faster generation. CUDA extension not installed. CUDA extension not installed. [INFO|modeling_utils.py:3934] 2025-02-20 17:17:37,544 >> loading weights file E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4\model.safetensors.index.json [INFO|modeling_utils.py:1670] 2025-02-20 17:17:37,553 >> Instantiating Qwen2ForCausalLM model under default dtype torch.float16. [INFO|configuration_utils.py:1096] 2025-02-20 17:17:37,554 >> Generate config GenerationConfig { "bos_token_id": 151643, "eos_token_id": 151645 }
C:\Users\123\miniconda3\Lib\site-packages\transformers\modeling_utils.py:5006: FutureWarning: _is_quantized_training_enabled is going to be deprecated in transformers 4.39.0. Please use model.hf_quantizer.is_trainable instead
warnings.warn(
[WARNING|logging.py:328] 2025-02-20 17:17:37,577 >> loss_type=None was set in the config but it is unrecognised.Using the default loss: ForCausalLMLoss.
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 2/2 [00:07<00:00, 3.61s/it]
[INFO|modeling_utils.py:4800] 2025-02-20 17:17:45,195 >> All model checkpoint weights were used when initializing Qwen2ForCausalLM.
[INFO|modeling_utils.py:4808] 2025-02-20 17:17:45,195 >> All the weights of Qwen2ForCausalLM were initialized from the model checkpoint at E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4. If your task is similar to the task the model of the checkpoint was trained on, you can already use Qwen2ForCausalLM for predictions without further training. [INFO|configuration_utils.py:1049] 2025-02-20 17:17:45,205 >> loading configuration file E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4\generation_config.json [INFO|configuration_utils.py:1096] 2025-02-20 17:17:45,206 >> Generate config GenerationConfig { "bos_token_id": 151643, "do_sample": true, "eos_token_id": [ 151645, 151643 ], "pad_token_id": 151643, "repetition_penalty": 1.05, "temperature": 0.7, "top_k": 20, "top_p": 0.8 }
02/20/2025 17:17:45 - INFO - llmtuner.model.utils.attention - Using torch SDPA for faster training and inference.
02/20/2025 17:17:45 - INFO - llmtuner.model.adapter - Upcasting trainable params to float32.
02/20/2025 17:17:45 - INFO - llmtuner.model.adapter - Fine-tuning method: LoRA
02/20/2025 17:17:46 - INFO - llmtuner.model.adapter - Loaded adapter(s): E:\Muice-Chatbot\model\Muice-2.7.1-Qwen2.5-7B-Instruct-GPTQ-Int4-8e-4
02/20/2025 17:17:46 - INFO - llmtuner.model.loader - all params: 1110384128
[INFO] 加载OFA图像模型...
Traceback (most recent call last):
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\utils\import_utils.py", line 451, in get_module
return importlib.import_module('.' + module_name, self.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\123\miniconda3\Lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "
File "C:\Users\123\miniconda3\Lib\site-packages\fairseq_init
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "E:\Muice-Chatbot\main.py", line 52, in
我再问一次你的 Python 版本号
3.10
试一下:
pip uninstall fairseq
python -m ensurepip --upgrade
git clone https://github.com/One-sixth/fairseq.git
cd fairseq
pip install -e .
同上(
[WARNING] 2025.02.10更新:由于配置文件格式变更,如果先前你拉取过本 Repo 并在 02.10 后执行过fetch操作,请您重新设置模型配置,由此带来的不便我们深表歉意 [INFO] 启动Muice-Chatbot中🚀... [INFO] 加载配置文件... [INFO] 配置文件存在,正在读取 [INFO] 加载模型:llmtuner [INFO|tokenization_utils_base.py:2209] 2025-02-20 18:25:21,027 >> loading file vocab.json [INFO|tokenization_utils_base.py:2209] 2025-02-20 18:25:21,027 >> loading file merges.txt [INFO|tokenization_utils_base.py:2209] 2025-02-20 18:25:21,028 >> loading file tokenizer.json [INFO|tokenization_utils_base.py:2209] 2025-02-20 18:25:21,028 >> loading file added_tokens.json [INFO|tokenization_utils_base.py:2209] 2025-02-20 18:25:21,028 >> loading file special_tokens_map.json [INFO|tokenization_utils_base.py:2209] 2025-02-20 18:25:21,028 >> loading file tokenizer_config.json [INFO|tokenization_utils_base.py:2475] 2025-02-20 18:25:21,239 >> Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. 02/20/2025 18:25:21 - INFO - llmtuner.data.template - Replace eos token: <|im_end|> [INFO|configuration_utils.py:677] 2025-02-20 18:25:21,240 >> loading configuration file E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4\config.json [INFO|configuration_utils.py:746] 2025-02-20 18:25:21,242 >> Model config Qwen2Config { "_name_or_path": "E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4", "architectures": [ "Qwen2ForCausalLM" ], "attention_dropout": 0.0, "bos_token_id": 151643, "eos_token_id": 151645, "hidden_act": "silu", "hidden_size": 3584, "initializer_range": 0.02, "intermediate_size": 18944, "max_position_embeddings": 32768, "max_window_layers": 28, "model_type": "qwen2", "num_attention_heads": 28, "num_hidden_layers": 28, "num_key_value_heads": 4, "quantization_config": { "batch_size": 1, "bits": 4, "block_name_to_quantize": null, "cache_block_outputs": true, "damp_percent": 0.01, "dataset": null, "desc_act": false, "exllama_config": { "version": 1 }, "group_size": 128, "max_input_length": null, "model_seqlen": null, "module_name_preceding_first_block": null, "modules_in_block_to_quantize": null, "pad_token_id": null, "quant_method": "gptq", "sym": true, "tokenizer": null, "true_sequential": true, "use_cuda_fp16": false, "use_exllama": true }, "rms_norm_eps": 1e-06, "rope_scaling": null, "rope_theta": 1000000.0, "sliding_window": null, "tie_word_embeddings": false, "torch_dtype": "float16", "transformers_version": "4.46.3", "use_cache": true, "use_sliding_window": false, "vocab_size": 152064 }
02/20/2025 18:25:21 - INFO - llmtuner.model.utils.quantization - Loading 4-bit GPTQ-quantized model. 02/20/2025 18:25:21 - INFO - llmtuner.model.patcher - Using KV cache for faster generation. CUDA extension not installed. CUDA extension not installed. [INFO|modeling_utils.py:3934] 2025-02-20 18:25:21,468 >> loading weights file E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4\model.safetensors.index.json [INFO|modeling_utils.py:1670] 2025-02-20 18:25:21,468 >> Instantiating Qwen2ForCausalLM model under default dtype torch.float16. [INFO|configuration_utils.py:1096] 2025-02-20 18:25:21,471 >> Generate config GenerationConfig { "bos_token_id": 151643, "eos_token_id": 151645 }
C:\Users\123\miniconda3\Lib\site-packages\transformers\modeling_utils.py:5006: FutureWarning: _is_quantized_training_enabled is going to be deprecated in transformers 4.39.0. Please use model.hf_quantizer.is_trainable instead
warnings.warn(
[WARNING|logging.py:328] 2025-02-20 18:25:21,487 >> loss_type=None was set in the config but it is unrecognised.Using the default loss: ForCausalLMLoss.
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 2/2 [00:02<00:00, 1.32s/it]
[INFO|modeling_utils.py:4800] 2025-02-20 18:25:24,520 >> All model checkpoint weights were used when initializing Qwen2ForCausalLM.
[INFO|modeling_utils.py:4808] 2025-02-20 18:25:24,520 >> All the weights of Qwen2ForCausalLM were initialized from the model checkpoint at E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4. If your task is similar to the task the model of the checkpoint was trained on, you can already use Qwen2ForCausalLM for predictions without further training. [INFO|configuration_utils.py:1049] 2025-02-20 18:25:24,523 >> loading configuration file E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4\generation_config.json [INFO|configuration_utils.py:1096] 2025-02-20 18:25:24,523 >> Generate config GenerationConfig { "bos_token_id": 151643, "do_sample": true, "eos_token_id": [ 151645, 151643 ], "pad_token_id": 151643, "repetition_penalty": 1.05, "temperature": 0.7, "top_k": 20, "top_p": 0.8 }
02/20/2025 18:25:24 - INFO - llmtuner.model.utils.attention - Using torch SDPA for faster training and inference.
02/20/2025 18:25:24 - INFO - llmtuner.model.adapter - Upcasting trainable params to float32.
02/20/2025 18:25:24 - INFO - llmtuner.model.adapter - Fine-tuning method: LoRA
02/20/2025 18:25:25 - INFO - llmtuner.model.adapter - Loaded adapter(s): E:\Muice-Chatbot\model\Muice-2.7.1-Qwen2.5-7B-Instruct-GPTQ-Int4-8e-4
02/20/2025 18:25:25 - INFO - llmtuner.model.loader - all params: 1110384128
[INFO] 加载OFA图像模型...
Traceback (most recent call last):
File "C:\Users\123\miniconda3\Lib\site-packages\modelscope\utils\import_utils.py", line 451, in get_module
return importlib.import_module('.' + module_name, self.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\123\miniconda3\Lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "
File "C:\Users\123\miniconda3\Lib\site-packages\fairseq_init
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "E:\Muice-Chatbot\main.py", line 52, in
顺便说一下,由于网络问题,第三条命令无法执行,我是直接下载的
把 C:\Users\123\miniconda3\ 里面的 python.exe 传上来给我看一下?
不让传.exe文件
网盘