初始化项目,由ModelHub XC社区提供模型

Model: zpeng1989/Medical_Qwen3_17B_Large_Language_Model
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-07-31 12:50:14 +08:00
commit cf48a85a6a
15 changed files with 910018 additions and 0 deletions

47
.gitattributes vendored Normal file
View File

@@ -0,0 +1,47 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bin.* filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zstandard filter=lfs diff=lfs merge=lfs -text
*.tfevents* filter=lfs diff=lfs merge=lfs -text
*.db* filter=lfs diff=lfs merge=lfs -text
*.ark* filter=lfs diff=lfs merge=lfs -text
**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text
**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text
**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.gguf* filter=lfs diff=lfs merge=lfs -text
*.ggml filter=lfs diff=lfs merge=lfs -text
*.llamafile* filter=lfs diff=lfs merge=lfs -text
*.pt2 filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text

14
Modelfile Normal file
View File

@@ -0,0 +1,14 @@
# ollama modelfile auto-generated by llamafactory
FROM .
TEMPLATE """{{ if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{ range .Messages }}{{ if eq .Role "user" }}<|im_start|>user
{{ .Content }}<|im_end|>
<|im_start|>assistant
{{ else if eq .Role "assistant" }}{{ .Content }}<|im_end|>
{{ end }}{{ end }}"""
PARAMETER stop "<|im_end|>"
PARAMETER num_ctx 4096

421
README.md Normal file
View File

@@ -0,0 +1,421 @@
# 医疗思考链问答大模型
## 项目概述
本项目旨在构建一个针对医疗知识的思考链条的问答大模型基于Qwen3-1.7B模型作为基座模型[Qwen/Qwen3-1.7B]使用LoRALow-Rank Adaptation技术进行微调。模型训练数据涵盖了医疗问诊、咨询等权威医学领域知识信息并通过问答题目进行微调以提升模型在医学领域的问答能力。这种数据预处理的策略充分挖掘了Qwen3模型强大的推理能力使其能够模拟在医疗场景中如何发现患者记录描述信息中获取到关联性的过程。
## 模型架构
- **基座模型**:[`Qwen/Qwen3-1.7B`]<https://modelscope.cn/models/Qwen/Qwen3-1.7B>
- **微调方法**: LoRALow-Rank Adaptation
- **训练数据**: 问答数据集
## 数据集
### 数据来源
参考链接:<https://huggingface.co/datasets/FreedomIntelligence/medical-o1-reasoning-SFT/tree/main>
### 数据预处理
训练数据格式:
```
{
"Question": "女性34岁双下肢麻木无力1年半感觉障碍自下而上发展。体检右侧胸8以下痛、温觉消失左侧胸以下痛、温觉减退。右下肢肌力Ⅳ级左下肢肌力Ⅲ级。左侧巴氏征阳性。病变的定性诊断应首先考虑为\nA. 脊膜瘤\nB. 神经纤维瘤\nC. 脑胶质瘤\nD. 椎管内转移瘤\nE. 脊髓髓内室管膜瘤",
"output": "<think>患者是一名34岁的女性她已经忍受了双下肢麻木无力有一年半了。她的症状是从脚下开始向上蔓延的。这听起来像是典型的神经问题特别是脊髓的事情。\n\n在体检中发现她的右侧胸8以下痛、温觉已经完全消失奇怪的是左侧则只是减退。这些提示我去考虑下可能是脊髓的问题尤其是可能在胸8这个区域出毛病了。\n\n她的巴氏征左侧是阳性的这表明脊髓半侧损害这就是所谓的Brown-Séquard综合征呀。嗯右下肢的肌力相较左侧还稍微好一点但情况都不妙。\n\n想到病变性质感觉病程发展这么缓慢说明是一种慢性病。可以是肿瘤那肿瘤的话髓内的或髓外的都有可能。这个就看到底是涉及到脊髓内还是外了。\n\n室管膜瘤这种病镇的可能存在脊髓内部而且病程缓慢符合这类症状的特点。哦不过要是脊髓外的问题那脊膜瘤这种可能会导致脊髓半侧损害这样就很吻合了。\n\n啊神经纤维瘤有时候也出现类似的症状不过更常见多发性问题和皮肤上的表现她没有这些其他症状。这有点排除掉。\n\n脑胶质瘤或者椎管内转移瘤不太可能造成这样的表现这个在脊髓半侧这样单纯的损害上不是那么直接。\n\n所以考虑到这些症状还有病变的特性我觉得首先还是脊膜瘤可能性最大特别是与这种Brown-Séquard综合征这样的一侧症状损害表现最吻合。</think>\n结合患者的症状和体检结果考虑到病变的性质以及脊髓半侧损害的特点这些特征非常符合脊膜瘤的表现。因此病变的定性诊断首先应考虑为脊膜瘤。\n\nA. 脊膜瘤"
}
```
## 模型训练
### 微调方法
使用LoRA技术对`Qwen3`模型进行微调。LoRA通过在预训练模型的权重矩阵中引入低秩矩阵来减少参数量从而在保持模型性能的同时降低计算成本。
### 训练步骤
1. **加载预训练模型**: 加载`Qwen3`1.7B模型。
2. **应用LoRA**: 在模型的关键层应用LoRA技术。
3. **训练模型**: 使用准备好的肿瘤知识问答数据集进行微调。
4. **验证与测试**: 在验证集和测试集上评估模型性能,调整超参数以优化结果。
## 模型评估
### 评估指标
- **准确率**: 模型在问答任务中的准确率。
- **召回率**: 模型能够正确回答的问题比例。
- **F1分数**: 准确率和召回率的调和平均数。
### 评估结果
在测试集上的评估结果如下:
待更新
## 使用指南
### 环境配置
1. **Python版本**: 3.10+
2. **依赖库**:
- `transformers`
- `torch`
### 模型下载
SDK下载
```bash
#安装ModelScope
pip install modelscope
```
```python
#SDK模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('')
```
Git下载
```
#Git模型下载
git clone
```
### 模型推理
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
# 加载微调后的模型
model = AutoModelForCausalLM.from_pretrained("path_to_your_model")
tokenizer = AutoTokenizer.from_pretrained("path_to_your_model")
# 输入问题
question = "请列出所有与葡萄胎相关的症状和体征?"
inputs = tokenizer(question, return_tensors="pt")
# 生成答案
outputs = model.generate(**inputs)
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(answer)
```
### WEB部署
代码参考:
```
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
import streamlit as st
import re
# 在侧边栏中创建一个标题和一个链接
with st.sidebar:
st.markdown("## 7B LLM")
max_length = st.slider("max_length", 0, 8192, 8192, step=1)
temperature = st.slider("temperature", 0.0, 1.0, 0.1, step=0.1)
# 创建一个标题和一个副标题
st.title("Model Chatbot")
st.caption("🚀 A streamlit chatbot powered by Self-LLM")
# 定义模型路径
mode_name_or_path = ''
# 文本分割函数
def split_text(text):
pattern = re.compile(r'<think>(.*?)</think>(.*)', re.DOTALL) # 定义正则表达式模式
match = pattern.search(text) # 匹配 <think>思考过程</think>回答
if match: # 如果匹配到思考过程
think_content = match.group(1).strip() # 获取思考过程
answer_content = match.group(2).strip() # 获取回答
else:
think_content = "" # 如果没有匹配到思考过程,则设置为空字符串
answer_content = text.strip() # 直接返回回答
return think_content, answer_content
# 定义一个函数,用于获取模型和 tokenizer
@st.cache_resource
def get_model():
# 从预训练的模型中获取 tokenizer
tokenizer = AutoTokenizer.from_pretrained(mode_name_or_path, trust_remote_code=True)
tokenizer.pad_token = tokenizer.eos_token
# 从预训练的模型中获取模型,并设置模型参数
model = AutoModelForCausalLM.from_pretrained(mode_name_or_path, torch_dtype=torch.bfloat16, device_map="auto")
return tokenizer, model
# 加载 model 和 tokenizer
tokenizer, model = get_model()
# 如果 session_state 中没有 "messages",则创建一个包含默认消息的列表
if "messages" not in st.session_state:
st.session_state["messages"] = [{"role": "assistant", "content": "有什么可以帮您的?"}]
# 遍历 session_state 中的所有消息,并显示在聊天界面上
for msg in st.session_state.messages:
st.chat_message(msg["role"]).write(msg["content"])
# 如果用户在聊天输入框中输入了内容,则执行以下操作
if prompt := st.chat_input():
# 在聊天界面上显示用户的输入
st.chat_message("user").write(prompt)
# 将用户输入添加到 session_state 中的 messages 列表中
st.session_state.messages.append({"role": "user", "content": prompt})
# 将对话输入模型,获得返回
input_ids = tokenizer.apply_chat_template(st.session_state.messages,tokenize=False,add_generation_prompt=True)
model_inputs = tokenizer([input_ids], return_tensors="pt").to('cuda')
generated_ids = model.generate(model_inputs.input_ids,max_new_tokens=max_length, temperature=temperature)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
think_content, answer_content = split_text(response) # 调用split_text函数分割思考过程和回答
# 将模型的输出添加到 session_state 中的 messages 列表中
st.session_state.messages.append({"role": "assistant", "content": response})
# 在聊天界面上显示模型的输出
with st.expander("模型思考过程"):
st.write(think_content) # 展示模型思考过程
st.chat_message("assistant").write(answer_content) # 输出模型回答
# print(st.session_state) # 打印 session_state 调试
```
运行命令:
```
# nohup streamlit run Run_Test_v1.py --server.address 0.0.0.0 --server.port 6006 &
```
### 生成结果案例
#### Case 01
输入问题:
```
患者信息如下:"""现病史
1病史摘要
病人49岁3小时前解大便后出现右下腹疼痛右下腹可触及一包块既往体健。
2主诉
右下腹痛并自扪及包块3小时。
体格检查
体温: T 37.8℃P 101次呼吸22次/分BP 100/60mmHg腹软未见胃肠型蠕动波肝脾肋下未及于右侧腹股沟区可扪及一圆形肿块约4cm×4cm大小有压痛、界欠清且肿块位于腹股沟韧带上内方。
辅助检查
1实验室检查
血常规WBC 5.0×109LN 78
尿常规正常。
2多普勒超声检查
沿腹股沟纵切可见一多层分布的混合回声区宽窄不等远端膨大边界整齐长约45cm。
3腹部X线检查
可见阶梯状液气平。"""具体工作:简述该病人的诊断及诊断依据。
```
模型增加<think>返回结果:
```
<think>患者的情况是右下腹痛并能触摸到包块,很快我想这可能不是普通的胃肠道问题,因为这些典型的胃痛通常伴随胃酸过多或消化不良,但眼前并没有这些病史。而是应该考虑一些其他地方的病因。
他的体温是37.8℃,虽然不算特别高,但结合上其他症状,提示可能有炎症。指出去,会不会有全身性的感染?我们得往更深层次的原因去追查。
疼痛的位置也很关键。这个疼痛点,尤其在右侧腹股沟区以及右下腹,让我联想到特异性的问题,比如精囊炎或者精索静脉曲张。不过,这个精索的问题通常不会造成剧烈疼痛和触包块。
再看看他的血常规结果白细胞增高到5.0×109中性球蛋白达78%这明显是炎症反应。腹部X线显示阶梯状液气平这常见于肠梗阻尤其在盲肠处。
多普勒超声的结果也很有价值。这里显示的是一个混合回声的肿块,远端膨大,这种特征通常暗示它是一个实性和液性混合的肿物,而不是单纯的炎症。
不过重点还是在右侧腹股沟区这个位置的炎症或肿物最常见的是精囊囊肿或者精索静脉曲张。但是精囊炎和静脉曲张不太能解释目前的X线检查。
等等从解剖结构来看这里在4cm×4cm的区域如果界线不清也有可能是深部的淋巴结反应。位置也在腹股沟韧带上内方这位置上的淋巴结反应确实值得考虑。
仔细分析,结合患者的所有症状、实验室检查结果和影像学特征,这个区域的疼痛和包块很可能不是局限于精囊囊肿或精索静脉曲张,而是一种全身性反应或更深层的问题。
想想看,精囊或精索炎症造成的局部反应,还可能是阑尾炎或腹膜炎,因为阶梯状液气平也提示盲肠附近有问题。然而,鉴于包块的特征和界不清,我可能得把重点放在腹腔内较深位置。
更深入的检查比如CT或MRI可以帮助确认但目前结合这些信息我觉得右侧腹腔脓肿也是一个可能。它会引起剧烈疼痛和包块就像感染引起的反应性改变。
经过这么多思考,我倾向于认为是右侧腹腔脓肿。因为这种以全身症状和包块为主的病症,与患者当前的表现非常吻合。所有的特征似乎指向了这一诊断,这可能是更合理且符合患者情况的诊断。</think>
根据患者的症状、体格检查结果以及辅助检查结果,该患者最可能的诊断是右侧腹腔脓肿。
诊断依据如下:
1. **症状**:患者出现了急性右下腹痛并触及包块,这是一种典型的腹膜炎疼痛表现。腹腔脓肿通常会导致急性、剧烈的腹痛和局部肿胀。
2. **体格检查**体温为37.8℃,虽不高但结合其他症状提示存在炎症反应。此外,腹软且未见胃肠型蠕动波,增加腹腔病变的可能性。
3. **实验室检查**白细胞计数增高到5.0×10^9/L且中性球蛋白增高到78%,这提示机体对感染的应答。
4. **影像学特征**多普勒超声显示在右侧腹股沟区域有一个界不清的肿块呈混合回声长45cm这与脓肿的特征相符。腹部X线检查显示阶梯状液气平提示可能存在肠道梗阻尤其是盲肠附近。
5. **位置特征**:右侧腹股沟区的肿块位于腹股沟韧带上内方,这种位置也可能与腹腔脓肿更为常见发生的部位一致。
综上所述结合患者的所有临床表现和检查结果右侧腹腔脓肿是一个合理且符合患者表现的诊断。进一步的影像学检查如CT或MRI可以确认此诊断并指导后续治疗。
```
模型去除<think>返回结果:
```
根据患者的现病史和体格检查信息这位49岁男性患者表现出右下腹和腹股沟地区的剧烈疼痛同时还摸到了包块。首先让我们来看看他的实验室检查结果。
他的血常规显示白细胞计数WBC为5.0×10^9/L其中多数是中性粒细胞N 78%)。这个白细胞计数的升高通常提示有炎症或感染。结合他的疼痛和包块,这似乎是一个有力的指向,可能是感染或炎症引起的。
再看看腹股沟区的触诊发现。肿块位于腹股沟韧带上内方有界不清的情况且有压痛。这很像是腹股沟直肠管脓肿PTWS的特征。这个发现特别吸引人注意因为这个症状在PTWS中是非常经典的。
超声检查结果显示沿腹股沟纵切可以看到一多层分布的混合回声区宽窄不等远端膨大长约45cm。这个描述很像是阶梯状肿块的表现非常符合腹股沟直肠管脓肿的超声特征。
虽然X线检查提示了阶梯状液气平但结合上述所有信息这似乎并不是阶梯状气液平面最突出的地方诊断重点还是放在腹股沟直肠管脓肿上。
尽管有便痛的主诉,但没有提到明确的感染征兆,如白细胞进一步显著升高或脓液征象,因此结合所有信息来看,腹股沟直肠管脓肿的诊断可能性更高。
综上所述,结合患者的疼痛、包块特征、实验室检查异常以及超声特征,我认为最可能的诊断是腹股沟直肠管脓肿。诊断依据包括白细胞升高、腹股沟区可触及包块的压痛以及超声所显示的混合回声区特征。
```
参考答案
```
诊断:嵌顿性腹股沟斜疝合并肠梗阻。
诊断依据:
①右下腹痛并自扪及包块3小时
②有腹胀、呕吐类似肠梗阻表现腹部平片可见阶梯状液平考虑肠梗阻可能腹部B超考虑
腹部包块内可能为肠管可能;
③有轻度毒性反应或是中毒反应,如 T 37.8℃P 101次白细胞中性分类78
④腹股沟区包块位于腹股沟韧带上内方。
```
#### Case 02
输入问题
```
患者信息如下:"""现病史
1病史摘要
杨XX59岁30年前无明显诱因开始出现反酸、反食、烧心胸骨后烧灼感伴胃胀、嗳气弯腰后反酸加重不规律服用“奥美拉唑、吗丁啉、莫沙必利”症状可缓解停药反复发作。5年前开始出现咳嗽、咳痰咳嗽严重时伴胸闷、喘息症状无明显季节性常于进食后1小时及凌晨发作止咳平喘效果不佳生活质量明显下降。2年前外院诊为“反流性食管炎LA-B、食管裂孔疝睡眠时床头抬高及、服用“耐信 20mg BID”反流症状明显缓解咳喘症状亦明显缓解。近10个月咳喘症状加重伴有听力下降调整耐信 40mg BID咳喘症状再次改善但仍时有发作。
2主诉
反酸、烧心30年咳嗽、咳痰、喘息5年加重10个月。
体格检查
结果 T36.8℃P70次/分R20次/分Bp136/80mmHg。
自主体位神志清楚全身皮肤及巩膜无黄染全身浅表淋巴结无肿大。双肺听诊呼吸音粗及散在哮鸣音。心率70次/分,律齐,未闻及病理性杂音,腹部平软,肝脏、脾脏未触及,未触及腹部包块,肠鸣音正常。
辅助检查
1实验室检查
出凝血功能:正常;血生化:正常;血常规:正常。
2胃镜
反流性食管炎LA-C食管裂孔疝混合型
3上消化道造影
反流性食管炎;食管裂孔疝。
4食管高分辨率测压
LES压力低于正常食管体部频繁无效食管裂孔疝。
5食管高分辨率测压
1.食管pH监测未达到胃食管病理性酸反流卧位酸廓清能力下降。
2.食管阻抗监测:反流总次数正常,以酸反流为主;
3.症状相关性分析:监测期间咳嗽、喘息症状与弱酸反流相关。
辅助检查
胃镜:
所见齿状线上移约4cm可见多条纵行糜烂底部有融合齿状线不规整周围可见充血、水肿、糜烂。 贲门口松弛。反转胃镜可见食管裂孔疝疝囊。
结论反流性食管炎LA-C食管裂孔疝混合型
辅助检查
食管pH-阻抗监测口服PPI期间
食管pH监测显示 DeMeester积分为8.0(正常值<14.7酸反流时间百分比AET为2.1%(正常值<4.2%),卧位酸反流时间所占百分比大于正常。卧位酸清除时间延长。
食管阻抗监测显示食团反流总时间百分比BET为1.2%(正常值<1.4%立位食团反流时间百分比大于正常反流总次数为48次正常值<73次其中酸反流32次弱酸反流5次弱碱反流3次酸性气体反流2次弱酸性气体反流4次弱碱性气体反流2次。立位食团清除时间延长。
症状相关性分析:
1、患者监测期间共记录咳嗽症状17次与弱酸反流相关4次弱酸反流的SI为24%、SAP为99%。
2、患者监测期间共记录喘息症状5次与弱酸反流相关2次。弱酸反流的SI为40%SAP为 96%。
SI为反流/症状指数 ,参考值>50%SAP反流/症状相关概率,参考值>95%。
辅助检查
上消化道造影:可见巨大食管裂孔疝,贲门及胃底均疝入胸腔。
辅助检查
食管高分辨率测压:
LES压力低于正常吞咽时松弛正常。
UES压力低于正常松弛功能欠佳。
食管体部频繁无效蠕动 (无效吞咽百分比50%) 。
食管裂孔疝。"""具体工作:分析本例病人的病史、体格检查和辅助检查。
```
模型增加<think>返回结果:
```
<think>这个病人的病史挺长的反酸和烧心已经有30年了从59岁才开始出现咳嗽和喘息的症状这些问题已经拖了5年。最近还有10个月的咳喘加重这可不太好。
再看看他的体格检查体温36.8心率70这些是正常范围但双肺有哮鸣音这可能说明有气道的问题。哎食管裂孔疝也在体检时发现不过这和病情有什么关系呢
看一下他的辅助检查吧。胃镜显示食管糜烂这可是反流性食管炎LA-C食管裂孔疝真是麻烦。血检啥都正常的上消化道造影也证实了食管裂孔疝。
尤其是食管pH和阻抗监测酸反流明显比正常值要频繁这已经不是小问题。酸反流时间百分比等都超出范围看来药物治疗效果也不大好。
食管高分辨率测压说LES压力总是无效这可影响胃部正常功能。这样一来看患者的问题不只是胃的问题还伴随着呼吸和咳嗽的困扰。
咳嗽和喘息症状记录中咳嗽症状与弱酸反流有明显关联。看一下症状相关性分析咳嗽的SI只有24%,而对于症状相关性要求>50%才算高相关。喘息的SI是40%,也接近但不够高。
综合这些信息,这个病人主要就是反流性食管炎,症状复杂,还伴有咳嗽和喘息,这严重影响了他的生活质量。嗯,可能需要考虑更有效的治疗方案,特别是针对咳嗽症状的措施。
所以,综合考虑,这个病人需要认真处理酸反流引起的咳嗽症状,同时继续处理明确的反流性食管炎问题。也许在控制酸反流的基础上,使用更合适的止咳药物会更好。</think>
根据提供的病史资料这位59岁的女性病人有长期的反酸和烧心症状伴随5年的咳嗽、咳痰和喘息症状最近10个月来咳喘症状加重还伴有听力下降。通过详细的病史、体格检查和辅助检查可以明确患者主要面临的问题是反流性食管炎以及由于反流诱发的咳嗽症状严重。
首先从病史来看患者从30年前就开始有反酸、烧心的症状经过长期的胃部问题处理最近5年又出现了严重的呼吸系统症状咳嗽和喘息。这些呼吸症状伴随较弱的酸反流与症状相关性不佳。
体格检查显示患者无明显黄疸和异常心肺杂音,这些结果提示患者身体状态良好,但双肺有哮鸣音,这提示可能存在气道高反应性。
在辅助检查方面胃镜及多方面的食管pH和阻抗监测都明确显示患者有显著的食管裂孔疝和明确的酸反流问题。食管内频繁的酸反流尤其是弱酸反流与患者咳嗽和喘息症状密切相关。此外食管高分辨率测压结果也提示LES压力无效食管无效蠕动增加了症状的复杂性。
从症状相关性分析来看咳嗽和喘息症状与弱酸反流有较高的相关性虽然达到24%和40%的相关性,但尚需结合患者的具体症状表现,考虑更优的治疗方案。
因此建议继续优化PPI治疗控制酸反流问题同时针对患者酸反流诱发的咳嗽症状制定措施。可以考虑在现有PPI基础上进一步延长卧位酸清除时间或者结合使用止咳药物来改善生活质量。在方案实施过程中需密切监测症状改善情况必要时进行调整。
```
模型去除<think>返回结果:
```
从病人的病史、体格检查和辅助检查结果来看,这位病人患有较为复杂的消化系统和呼吸系统疾病,我们需要综合分析这些信息,以更好地理解她的病情和制定治疗方案。
---
### 一、病史分析
病人自30年前开始出现胃酸相关症状如反酸、反食、烧心这些症状与胃泌素分泌过多有关。虽然她一直使用“奥美拉唑"等质子泵抑制剂治疗这些症状,但症状在停药后反复发作,这进一步支持了反流性食管炎的诊断。
在过去的5年内病人开始出现咳嗽和咳痰的症状且发作时常伴有胸闷、喘息显然影响了她的生活质量。虽然止咳平喘药物效果不佳但咳嗽和喘息的症状与她的反流情况有明显相关性。
在2年前病人在外院曾出现咳喘症状明显改善通过调整上消化道药物和调整睡眠体位反流症状明显缓解。这表明通过纠正反流因素咳喘症状得到了一些改善。
近10个月来病人咳喘症状加重同时伴有听力下降尽管在调整耐信一种丙戊酸钠剂量后咳喘症状再次获得一定程度的缓解。
---
### 二、体格检查
病人呈自主体位生命体征为T36.8℃P70次/分R20次/分Bp136/80mmHg神志清醒未闻及病理杂音呼吸有粗略声和散在哮鸣音。
这些体征提示病人有呼吸系统不适,但并未见明显的严重呼吸障碍。
---
### 三、辅助检查
#### 1实验室检查
实验室检查结果均在正常范围内,这排除了凝血功能和一般全身炎症指标的异常。
---
#### 2胃镜检查
胃镜检查明确诊断病人患有反流性食管炎且存在食管裂孔疝且为混合型疝。齿状线上移约4cm伴有糜烂提示胃黏膜的损害。
---
#### 3上消化道造影
造影结果同样提示有巨大食管裂孔疝,贲门和胃底疝入胸腔,进一步证实食管裂孔疝的存在。
---
#### 4食管pH-阻抗监测
- **pH监测**显示DeMeester积分小于正常说明胃酸反流的可能性较大睡眠时酸反流时间百分比大于正常。
- **食管阻抗监测**显示立位时食团反流总次数大于正常食管裂孔疝也是原因之一。反流总次数为48次正常值<73次其中32次为酸反流表明频繁的胃内容反流是导致病人症状加重的原因之一。
---
#### 5食管高分辨率测压LES和1.5 MHz
- **LES食管酸刺激压力监测**显示压力低于正常,无效蠕动频繁,提示酸刺激频繁且影响较广。
- **症状相关性分析**显示:
- 咳嗽症状共记录17次与弱酸反流相关4次。SI反流/症状指数为24%、SAP反流/症状相关概率为99%。这表明咳嗽症状与较弱的胃酸反流相关。
- 喀息症状共记录5次与弱酸反流相关2次。SI为40%SAP为96%。这说明喘息症状与较弱的胃酸反流也有一定的相关性。
---
综上所述病人的诊断高度疑似反流性食管炎伴食管裂孔疝。治疗上首先需通过手术纠正食管裂孔疝以彻底解决她的反流问题。在手术前后使用质子泵抑制剂如PPI和适当管理反流诱发症状的药物将是当前的主要治疗策略。
在质子泵抑制剂的使用期间,病人应密切监测食管反流诱发的症状,并在症状相关的情况下,考虑食管高分辨率测压等进一步的精准评估。
通过综合管理,期望能有效改善病人的生活质量。
```
参考结果
```
1病史分析该病例的早期症状为反酸、反食、烧心胸骨后烧灼感、嗳气等典型胃食管反流症状为主抗反流用药治疗可缓解症状即可诊断为胃食管反流病。之后患者逐渐出现咳嗽、咳痰和喘息等哮喘样症状该症状呼吸内科治疗效果不佳再进行抗反流治疗后不但反酸、烧心得到明显缓解而且哮喘样症状也得到明显缓解。
本病例特点为:①先出现典型胃食管反流病症状,后出现咳嗽、喘息等食管外症状;②抗反流药物治疗可同时缓解反酸、烧心以及咳喘症状。
2体格检查分析体格检查方面此病例在咳喘发作间期无过多的阳性体征肺部听诊可闻及哮鸣音。
3辅助检查分析本例病人实验室检查无明显异常。通过胃镜、上消化道造影、食管高分辨率测压检查明确患者存在食管裂孔疝和反流性食管炎食管pH-阻抗检查口服PPI期间进一步证实患者的咳嗽和喘息症状均与反流有显著相关性。上述客观检查确诊患者为胃食管反流病反流性哮喘可能性大。
```
## 许可证
本项目采用 [MIT 许可证](LICENSE)。
## 致谢
- 感谢 `Qwen` 模型的开发者。
- 感谢所有为医疗知识问答数据集做出贡献的研究人员。
## 联系方式
如有任何问题,请联系 [592392714@qq.com]。
---
**注意**: 本项目仅供学术研究使用,不构成医疗建议。

28
added_tokens.json Normal file
View File

@@ -0,0 +1,28 @@
{
"</think>": 151668,
"</tool_call>": 151658,
"</tool_response>": 151666,
"<think>": 151667,
"<tool_call>": 151657,
"<tool_response>": 151665,
"<|box_end|>": 151649,
"<|box_start|>": 151648,
"<|endoftext|>": 151643,
"<|file_sep|>": 151664,
"<|fim_middle|>": 151660,
"<|fim_pad|>": 151662,
"<|fim_prefix|>": 151659,
"<|fim_suffix|>": 151661,
"<|im_end|>": 151645,
"<|im_start|>": 151644,
"<|image_pad|>": 151655,
"<|object_ref_end|>": 151647,
"<|object_ref_start|>": 151646,
"<|quad_end|>": 151651,
"<|quad_start|>": 151650,
"<|repo_name|>": 151663,
"<|video_pad|>": 151656,
"<|vision_end|>": 151653,
"<|vision_pad|>": 151654,
"<|vision_start|>": 151652
}

30
config.json Normal file
View File

@@ -0,0 +1,30 @@
{
"architectures": [
"Qwen3ForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 151643,
"eos_token_id": 151645,
"head_dim": 128,
"hidden_act": "silu",
"hidden_size": 2048,
"initializer_range": 0.02,
"intermediate_size": 6144,
"max_position_embeddings": 40960,
"max_window_layers": 28,
"model_type": "qwen3",
"num_attention_heads": 16,
"num_hidden_layers": 28,
"num_key_value_heads": 8,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 1000000,
"sliding_window": null,
"tie_word_embeddings": true,
"torch_dtype": "bfloat16",
"transformers_version": "4.51.3",
"use_cache": true,
"use_sliding_window": false,
"vocab_size": 151936
}

1
configuration.json Normal file
View File

@@ -0,0 +1 @@
{"task":"text-generation"}

13
generation_config.json Normal file
View File

@@ -0,0 +1,13 @@
{
"bos_token_id": 151643,
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"temperature": 0.6,
"top_k": 20,
"top_p": 0.95,
"transformers_version": "4.51.3"
}

151388
merges.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:50464e7745e8b8d25a6bdb0d20a865db6c2ab067b5ebee7426bc36700eacb64b
size 1981415312

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:093b82f57fd5e4c1d00cabdcd6a4701cc0b160ec49d477f223473380371b0379
size 1459770104

View File

@@ -0,0 +1,317 @@
{
"metadata": {
"total_size": 3441149952
},
"weight_map": {
"model.embed_tokens.weight": "model-00001-of-00002.safetensors",
"model.layers.0.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.10.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.11.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.12.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.13.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.13.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.13.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.13.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.13.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.14.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.14.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.14.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.14.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.14.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.14.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.14.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.14.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.14.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.14.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.14.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.15.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.15.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.15.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.15.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.15.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.15.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.15.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.15.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.15.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.15.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.15.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.16.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.16.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.16.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.16.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.16.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.16.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.16.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.16.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.16.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.16.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.16.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.17.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.17.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.17.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.17.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.17.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.17.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.17.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.17.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.17.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.17.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.17.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.18.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.18.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.18.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.18.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.18.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.18.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.18.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.18.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.18.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.18.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.18.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.19.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.19.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.19.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.19.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.19.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.19.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.19.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.19.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.19.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.19.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.19.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.2.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.2.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.20.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.20.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.20.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.20.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.20.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.20.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.20.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.20.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.20.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.20.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.20.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.21.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.22.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.23.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.24.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.25.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.26.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.input_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.k_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.q_norm.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.27.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
"model.layers.3.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.4.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.5.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.6.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.7.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.8.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.input_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.k_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.q_norm.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
"model.layers.9.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
"model.norm.weight": "model-00002-of-00002.safetensors"
}
}

31
special_tokens_map.json Normal file
View File

@@ -0,0 +1,31 @@
{
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"eos_token": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

757480
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

241
tokenizer_config.json Normal file
View File

@@ -0,0 +1,241 @@
{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"151643": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151644": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151645": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151646": {
"content": "<|object_ref_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151647": {
"content": "<|object_ref_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151648": {
"content": "<|box_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151649": {
"content": "<|box_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151650": {
"content": "<|quad_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151651": {
"content": "<|quad_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151652": {
"content": "<|vision_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151653": {
"content": "<|vision_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151654": {
"content": "<|vision_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151655": {
"content": "<|image_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151656": {
"content": "<|video_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151657": {
"content": "<tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151658": {
"content": "</tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151659": {
"content": "<|fim_prefix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151660": {
"content": "<|fim_middle|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151661": {
"content": "<|fim_suffix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151662": {
"content": "<|fim_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151663": {
"content": "<|repo_name|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151664": {
"content": "<|file_sep|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151665": {
"content": "<tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151666": {
"content": "</tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151667": {
"content": "<think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151668": {
"content": "</think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
}
},
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"bos_token": null,
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set content = message.content %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is defined and message.reasoning_content is not none %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in message.content %}\n {%- set content = message.content.split('</think>')[-1].lstrip('\\n') %}\n {%- set reasoning_content = message.content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}",
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"errors": "replace",
"extra_special_tokens": {},
"model_max_length": 131072,
"pad_token": "<|endoftext|>",
"padding_side": "left",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null
}

1
vocab.json Normal file

File diff suppressed because one or more lines are too long