[Bug]: 模型运行日志上只输出接收内容,不回复消息
问题描述
感觉跟#46不一样,程序开始运行后确实会接收到消息并输出日志,但是当我发消息给机器人时机器人并没有回复我,就连程序输出日志上也没有我的消息(在我的群里发消息也一样),都是来自其他群的消息
相关日志输出
[WARNING] 2025.02.10更新:由于配置文件格式变更,如果先前你拉取过本 Repo 并在 02.10 后执行过fetch操作,请您重新设置模型配置,由此带来的不便我们深表歉意
[INFO] 启动Muice-Chatbot中🚀...
[INFO] 加载配置文件...
[INFO] 配置文件存在,正在读取
[INFO] 加载模型:llmtuner
[INFO|tokenization_utils_base.py:2209] 2025-02-16 21:22:53,491 >> loading file vocab.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 21:22:53,491 >> loading file merges.txt
[INFO|tokenization_utils_base.py:2209] 2025-02-16 21:22:53,491 >> loading file tokenizer.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 21:22:53,491 >> loading file added_tokens.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 21:22:53,491 >> loading file special_tokens_map.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 21:22:53,491 >> loading file tokenizer_config.json
[INFO|tokenization_utils_base.py:2475] 2025-02-16 21:22:53,700 >> Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
02/16/2025 21:22:53 - INFO - llmtuner.data.template - Replace eos token: <|im_end|>
[INFO|configuration_utils.py:677] 2025-02-16 21:22:53,701 >> loading configuration file E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4\config.json
[INFO|configuration_utils.py:746] 2025-02-16 21:22:53,704 >> 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 21:22:53 - INFO - llmtuner.model.utils.quantization - Loading 4-bit GPTQ-quantized model.
02/16/2025 21:22:53 - 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 21:22:53,927 >> 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 21:22:53,928 >> Instantiating Qwen2ForCausalLM model under default dtype torch.float16.
[INFO|configuration_utils.py:1096] 2025-02-16 21:22:53,929 >> 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 21:22:53,946 >> `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.31s/it]
[INFO|modeling_utils.py:4800] 2025-02-16 21:22:56,980 >> All model checkpoint weights were used when initializing Qwen2ForCausalLM.
[INFO|modeling_utils.py:4808] 2025-02-16 21:22:56,980 >> 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 21:22:56,982 >> loading configuration file E:\Muice-Chatbot\model\Qwen2.5-7B-Instruct-GPTQ-Int4\generation_config.json
[INFO|configuration_utils.py:1096] 2025-02-16 21:22:56,984 >> 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 21:22:56 - INFO - llmtuner.model.utils.attention - Using torch SDPA for faster training and inference.
02/16/2025 21:22:56 - INFO - llmtuner.model.adapter - Upcasting trainable params to float32.
02/16/2025 21:22:56 - INFO - llmtuner.model.adapter - Fine-tuning method: LoRA
02/16/2025 21:22:57 - 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 21:22:57 - INFO - llmtuner.model.loader - all params: 1110384128
[INFO] 加载Faiss记忆组件...
[INFO|configuration_utils.py:677] 2025-02-16 21:22:58,483 >> loading configuration file E:\Muice-Chatbot\model\distiluse-base-multilingual-cased-v1\config.json
[INFO|configuration_utils.py:746] 2025-02-16 21:22:58,485 >> 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 21:22:58,614 >> loading weights file E:\Muice-Chatbot\model\distiluse-base-multilingual-cased-v1\model.safetensors
[INFO|modeling_utils.py:4800] 2025-02-16 21:22:58,629 >> All model checkpoint weights were used when initializing DistilBertModel.
[INFO|modeling_utils.py:4808] 2025-02-16 21:22:58,629 >> 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 21:22:58,631 >> loading configuration file E:\Muice-Chatbot\model\distiluse-base-multilingual-cased-v1\config.json
[INFO|configuration_utils.py:746] 2025-02-16 21:22:58,631 >> 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 21:22:58,634 >> loading file vocab.txt
[INFO|tokenization_utils_base.py:2209] 2025-02-16 21:22:58,634 >> loading file tokenizer.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 21:22:58,634 >> loading file added_tokens.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 21:22:58,634 >> loading file special_tokens_map.json
[INFO|tokenization_utils_base.py:2209] 2025-02-16 21:22:58,634 >> loading file tokenizer_config.json
[INFO|configuration_utils.py:677] 2025-02-16 21:22:58,634 >> loading configuration file E:\Muice-Chatbot\model\distiluse-base-multilingual-cased-v1\config.json
[INFO|configuration_utils.py:746] 2025-02-16 21:22:58,635 >> 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] 初始化Bot服务...
>>>[INFO] 尝试与QQ建立WebSocket连接...
INFO: Started server process [3436]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:21050 (Press CTRL+C to quit)
INFO: ('127.0.0.1', 61142) - "WebSocket /ws/api" [accepted]
INFO: connection open
[INFO] 沐雪Chatbot已在运行中✨
[INFO] 收到来自群*保密*的消息:对不起了月亮
[INFO] 收到来自群*保密*的消息:人之常情
[INFO] 收到来自群*保密*的消息:顺手的事
[INFO] 收到来自群*保密*的消息:
[INFO] 收到来自群*保密*的消息:实则不然
配置文件
# 模型相关
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: 3954936973 # 机器人QQ号
port: 21050 # LLOneBot反向WebSocket服务端口
wait_reply: true # 拟人化回复(回复前等待一段时间)
cq_code: false # 是否解析CQ码
anyone: true # 是否回复所有人
trusted: # 可信QQ号(当anyone为false时生效)
- 1718479057
group:
enable: true # 是否启用群聊回复
only_at: false # 是否只回复at自己的消息
rate: 0.5 # 群聊回复概率(only_at为false时生效)
anyone: false # 是否回复所有群组
trusted: # 可信群组(当anyone为false时生效)
- 1022931951
only_trusted: false # 是否只回复可信QQ号
cmd_only_trusted: true # 是否只执行可信QQ号的命令
nonreply_prefix: # 不回复消息的前缀
- '!'
- !
- '#'
# 主动对话相关
platform: qq # 聊天平台 qq/telegram
nickname: 观众大大
active:
enable: true # 是否启用主动对话
rate: 0.02 # 主动对话概率(每分钟)
active_prompts:
- '<生成推文: 胡思乱想>'
- '<生成推文: AI生活>'
- '<生成推文: AI思考>'
- '<生成推文: 表达爱意>'
- '<生成推文: 情感建议>'
not_disturb: false # 是否开启免打扰模式
shecdule:
enable: true # 是否启用定时任务
rate: 0.75 # 定时任务概率(每次)
tasks:
- hour: 8
prompt: '<日常问候: 早上>'
- hour: 12
prompt: '<日常问候: 中午>'
- hour: 18
prompt: '<日常问候: 傍晚>'
- hour: 22
prompt: '<日常问候: 深夜>'
targets: # 主动对话目标QQ号
- 1718479057
- 23456789
# 其他可选服务
# OFA 图像识别
ofa_image:
enable: false # 是否启用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.使用python main.py运行程序 2.程序成功运行 3.发送消息,然而并未回复
其他信息
消息界面和LLOneBot配置
你把你log文件夹下面的日志文件给我看一下
2025-02-16.log
感觉跟#46不一样,程序开始运行后确实会接收到消息并输出日志,但是当我发消息给机器人时机器人并没有回复我,就连程序输出日志上也没有我的消息(在我的群里发消息也一样),都是来自其他群的消息
我想确认一点,你运行LLonebot时,QQ登录的账号是不是 机器人 的账号
不是
是我自己的
2025-02-16.log
log文件似乎没有上传
2025-02-16.log
log文件似乎没有上传
为了隐私考虑,我删了
感觉跟#46不一样,程序开始运行后确实会接收到消息并输出日志,但是当我发消息给机器人时机器人并没有回复我,就连程序输出日志上也没有我的消息(在我的群里发消息也一样),都是来自其他群的消息
我想确认一点,你运行LLonebot时,QQ登录的账号是不是 机器人 的账号
请问你是否是使用bot账号对自己发送消息?
感觉跟#46不一样,程序开始运行后确实会接收到消息并输出日志,但是当我发消息给机器人时机器人并没有回复我,就连程序输出日志上也没有我的消息(在我的群里发消息也一样),都是来自其他群的消息
我想确认一点,你运行LLonebot时,QQ登录的账号是不是 机器人 的账号
请问你是否是使用bot账号对自己发送消息?
你的意思是...用bot账号给我的账号发消息? 如果是的话,那我没有 如果是用我的账号给bot账号发消息的话,那我在运行时发过问候语,然而bot并没有回复我
请在LLonebot中打开写入日志, 然后再次复现并提供LLonebot的日志文件
请在LLonebot中打开写入日志, 然后再次复现并提供LLonebot的日志文件
2025-02-16.log
翻到最下面,那是刚刚最近的
这个是muice的日志, 我希望获取llonebot的日志以获取更多信息
LLbot写入日志开了,话说在哪看?
哦哦,找到了
最底下应该是最新的
llonebot-2025-2-16 23-09-19.log
你启动了 qq********** 的llob, 但是这似乎并不是你的机器人账号
还要启动机器人的是吧
你仅需要启动机器人账号上的llob, 且你应该关闭其他账号上的llob