[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-Kent0n-Li--ChatDoctor":3,"tool-Kent0n-Li--ChatDoctor":65},[4,17,27,35,48,57],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",152630,2,"2026-04-12T23:33:54",[13,14,15],"开发框架","Agent","语言模型","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,3,"2026-04-06T11:19:32",[15,26,14,13],"图像",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":10,"last_commit_at":33,"category_tags":34,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":10,"last_commit_at":41,"category_tags":42,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",85092,"2026-04-10T11:13:16",[26,43,44,45,14,46,15,13,47],"数据工具","视频","插件","其他","音频",{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":54,"last_commit_at":55,"category_tags":56,"status":16},5784,"funNLP","fighting41love\u002FfunNLP","funNLP 是一个专为中文自然语言处理（NLP）打造的超级资源库，被誉为\"NLP 民工的乐园”。它并非单一的软件工具，而是一个汇集了海量开源项目、数据集、预训练模型和实用代码的综合性平台。\n\n面对中文 NLP 领域资源分散、入门门槛高以及特定场景数据匮乏的痛点，funNLP 提供了“一站式”解决方案。这里不仅涵盖了分词、命名实体识别、情感分析、文本摘要等基础任务的标准工具，还独特地收录了丰富的垂直领域资源，如法律、医疗、金融行业的专用词库与数据集，甚至包含古诗词生成、歌词创作等趣味应用。其核心亮点在于极高的全面性与实用性，从基础的字典词典到前沿的 BERT、GPT-2 模型代码，再到高质量的标注数据和竞赛方案，应有尽有。\n\n无论是刚刚踏入 NLP 领域的学生、需要快速验证想法的算法工程师，还是从事人工智能研究的学者，都能在这里找到急需的“武器弹药”。对于开发者而言，它能大幅减少寻找数据和复现模型的时间；对于研究者，它提供了丰富的基准测试资源和前沿技术参考。funNLP 以开放共享的精神，极大地降低了中文自然语言处理的开发与研究成本，是中文 AI 社区不可或缺的宝藏仓库。",79857,1,"2026-04-08T20:11:31",[15,43,46],{"id":58,"name":59,"github_repo":60,"description_zh":61,"stars":62,"difficulty_score":54,"last_commit_at":63,"category_tags":64,"status":16},6590,"gpt4all","nomic-ai\u002Fgpt4all","GPT4All 是一款让普通电脑也能轻松运行大型语言模型（LLM）的开源工具。它的核心目标是打破算力壁垒，让用户无需依赖昂贵的显卡（GPU）或云端 API，即可在普通的笔记本电脑和台式机上私密、离线地部署和使用大模型。\n\n对于担心数据隐私、希望完全掌控本地数据的企业用户、研究人员以及技术爱好者来说，GPT4All 提供了理想的解决方案。它解决了传统大模型必须联网调用或需要高端硬件才能运行的痛点，让日常设备也能成为强大的 AI 助手。无论是希望构建本地知识库的开发者，还是单纯想体验私有化 AI 聊天的普通用户，都能从中受益。\n\n技术上，GPT4All 基于高效的 `llama.cpp` 后端，支持多种主流模型架构（包括最新的 DeepSeek R1 蒸馏模型），并采用 GGUF 格式优化推理速度。它不仅提供界面友好的桌面客户端，支持 Windows、macOS 和 Linux 等多平台一键安装，还为开发者提供了便捷的 Python 库，可轻松集成到 LangChain 等生态中。通过简单的下载和配置，用户即可立即开始探索本地大模型的无限可能。",77307,"2026-04-11T06:52:37",[15,13],{"id":66,"github_repo":67,"name":68,"description_en":69,"description_zh":70,"ai_summary_zh":71,"readme_en":72,"readme_zh":73,"quickstart_zh":74,"use_case_zh":75,"hero_image_url":76,"owner_login":77,"owner_name":78,"owner_avatar_url":79,"owner_bio":80,"owner_company":81,"owner_location":82,"owner_email":69,"owner_twitter":69,"owner_website":69,"owner_url":83,"languages":84,"stars":89,"forks":90,"last_commit_at":91,"license":92,"difficulty_score":23,"env_os":93,"env_gpu":94,"env_ram":93,"env_deps":95,"category_tags":106,"github_topics":69,"view_count":10,"oss_zip_url":69,"oss_zip_packed_at":69,"status":16,"created_at":107,"updated_at":108,"faqs":109,"releases":140},7019,"Kent0n-Li\u002FChatDoctor","ChatDoctor",null,"ChatDoctor 是一款基于 Meta AI 的 LLaMA 大语言模型，经过医疗领域专业知识微调而成的智能医疗对话助手。它旨在模拟真实的医患沟通场景，能够理解患者描述的症状并提供初步的健康咨询建议。\n\n该项目主要解决了通用大模型在垂直医疗领域专业知识不足、回答不够严谨的问题。通过利用来自 HealthCareMagic 和 icliniq 等平台的数十万条真实医患对话数据，以及由 ChatGPT 生成的专业医学问答进行训练，ChatDoctor 显著提升了在疾病诊断、健康指导等方面的准确性与专业度。\n\nChatDoctor 非常适合人工智能研究人员、医疗科技开发者以及对医疗大模型感兴趣的技术爱好者使用。研究人员可将其作为医疗 NLP 领域的基准模型进行深入探索；开发者则能基于其开源代码和数据集，构建定制化的健康咨询应用或辅助诊疗系统。需要注意的是，由于模型输出尚未达到 100% 准确，官方明确提示切勿将其直接用于真实的临床诊疗决策，而应作为科研参考或辅助工具。\n\n其技术亮点在于构建了高质量的医疗指令微调数据集，并成功验证了将通用大语言模型迁移至专业医疗领域的可行性，为开源医疗 A","ChatDoctor 是一款基于 Meta AI 的 LLaMA 大语言模型，经过医疗领域专业知识微调而成的智能医疗对话助手。它旨在模拟真实的医患沟通场景，能够理解患者描述的症状并提供初步的健康咨询建议。\n\n该项目主要解决了通用大模型在垂直医疗领域专业知识不足、回答不够严谨的问题。通过利用来自 HealthCareMagic 和 icliniq 等平台的数十万条真实医患对话数据，以及由 ChatGPT 生成的专业医学问答进行训练，ChatDoctor 显著提升了在疾病诊断、健康指导等方面的准确性与专业度。\n\nChatDoctor 非常适合人工智能研究人员、医疗科技开发者以及对医疗大模型感兴趣的技术爱好者使用。研究人员可将其作为医疗 NLP 领域的基准模型进行深入探索；开发者则能基于其开源代码和数据集，构建定制化的健康咨询应用或辅助诊疗系统。需要注意的是，由于模型输出尚未达到 100% 准确，官方明确提示切勿将其直接用于真实的临床诊疗决策，而应作为科研参考或辅助工具。\n\n其技术亮点在于构建了高质量的医疗指令微调数据集，并成功验证了将通用大语言模型迁移至专业医疗领域的可行性，为开源医疗 AI 的发展提供了宝贵的数据资源与模型权重。","\u003Cp align=\"center\" width=\"80%\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKent0n-Li_ChatDoctor_readme_04818da4ab1f.png\" style=\"width: 40%; min-width: 300px; display: block; margin: auto;\">\n\u003C\u002Fp>\n\n\n# [ChatDoctor: A Medical Chat Model Fine-Tuned on a Large Language Model Meta-AI (LLaMA) Using Medical Domain Knowledge](https:\u002F\u002Fwww.cureus.com\u002Farticles\u002F152858-chatdoctor-a-medical-chat-model-fine-tuned-on-a-large-language-model-meta-ai-llama-using-medical-domain-knowledge#!\u002F)\nYunxiang Li\u003Csup>1\u003C\u002Fsup>, Zihan Li\u003Csup>2\u003C\u002Fsup>, Kai Zhang\u003Csup>3\u003C\u002Fsup>, Ruilong Dan\u003Csup>4\u003C\u002Fsup>, Steve Jiang\u003Csup>1\u003C\u002Fsup>, You Zhang\u003Csup>1\u003C\u002Fsup>\n\u003Ch5>1 UT Southwestern Medical Center, USA\u003C\u002Fh5>\n\u003Ch5>2 University of Illinois at Urbana-Champaign, USA\u003C\u002Fh5>\n\u003Ch5>3 Ohio State University, USA\u003C\u002Fh5>\n\u003Ch5>4 Hangzhou Dianzi University, China\u003C\u002Fh5>\n\n\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache_2.0-green.svg)](https:\u002F\u002Fgithub.com\u002FHUANGLIZI\u002FChatDoctor\u002Fblob\u002Fmain\u002FLICENSE) \n[![Python 3.9+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.9+-blue.svg)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002Frelease\u002Fpython-390\u002F) \n[![Page](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWeb-Page-yellow)](https:\u002F\u002Fwww.yunxiangli.top\u002FChatDoctor\u002F) \n## Resources List\nAutonomous ChatDoctor with Disease Database [Demo](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fkenton-li\u002Fchatdoctor_csv).\n\n100k real conversations between patients and doctors from HealthCareMagic.com [HealthCareMagic-100k](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1lyfqIwlLSClhgrCutWuEe_IACNq6XNUt\u002Fview?usp=sharing).\n\nReal conversations between patients and doctors from icliniq.com [icliniq-10k](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1ZKbqgYqWc7DJHs3N9TQYQVPdDQmZaClA\u002Fview?usp=sharing).\n\nCheckpoints of ChatDoctor, [link](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F11-qPzz9ZdHD6pc47wBSOUSU61MaDPyRh?usp=sharing).\n\nStanford Alpaca data for basic conversational capabilities. [Alpaca link](https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fblob\u002Fmain\u002Falpaca_data.json).\n\n\n\u003Cp align=\"center\" width=\"100%\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKent0n-Li_ChatDoctor_readme_76f937ff4dd0.png\" style=\"width: 70%; min-width: 300px; display: block; margin: auto;\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\" width=\"100%\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKent0n-Li_ChatDoctor_readme_254fc4ff1364.png\" style=\"width: 70%; min-width: 300px; display: block; margin: auto;\">\n\u003C\u002Fp>\n\n\n ## Setup:\n In a conda env with pytorch available, run:\n```\npip install -r requirements.txt\n```\n\n ## Interactive Demo Page:\nDemo Page: https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fkenton-li\u002Fchatdoctor_csv\nIt is worth noting that our model has not yet achieved 100% accurate output, please do not apply it to real clinical scenarios.\n\nFor those who want to try the online demo, please register for hugging face and fill out this form [link](https:\u002F\u002Fforms.office.com\u002FPages\u002FResponsePage.aspx?id=lYZBnaxxMUy1ssGWyOw8ij06Cb8qnDJKvu2bVpV1-ANURUU0TllBWVVHUjQ1MDJUNldGTTZWV1c5UC4u).\n\n ## Data and model:\n ### 1. ChatDoctor Dataset:\nYou can download the following training dataset\n\n100k real conversations between patients and doctors from HealthCareMagic.com [HealthCareMagic-100k](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1lyfqIwlLSClhgrCutWuEe_IACNq6XNUt\u002Fview?usp=sharing).\n\n10k real conversations between patients and doctors from icliniq.com [icliniq-10k](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1ZKbqgYqWc7DJHs3N9TQYQVPdDQmZaClA\u002Fview?usp=sharing).\n\n5k generated conversations between patients and physicians from ChatGPT [GenMedGPT-5k](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1nDTKZ3wZbZWTkFMBkxlamrzbNz0frugg\u002Fview?usp=sharing) and [disease database](https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fblob\u002Fmain\u002Fformat_dataset.csv). \n\nOur model was firstly be fine-tuned by Stanford Alpaca's data to have some basic conversational capabilities. [Alpaca link](https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fblob\u002Fmain\u002Falpaca_data.json)\n\n ### 2. Model Weights:\n\nPlace the model weights file in the .\u002Fpretrained folder.\n\n ## How to fine-tuning\n\n ```python\ntorchrun --nproc_per_node=4 --master_port=\u003Cyour_random_port> train.py \\\n    --model_name_or_path \u003Cyour_path_to_hf_converted_llama_ckpt_and_tokenizer> \\\n    --data_path .\u002FHealthCareMagic-100k.json \\\n    --bf16 True \\\n    --output_dir pretrained \\\n    --num_train_epochs 1 \\\n    --per_device_train_batch_size 4 \\\n    --per_device_eval_batch_size 4 \\\n    --gradient_accumulation_steps 8 \\\n    --evaluation_strategy \"no\" \\\n    --save_strategy \"steps\" \\\n    --save_steps 2000 \\\n    --save_total_limit 1 \\\n    --learning_rate 2e-6 \\\n    --weight_decay 0. \\\n    --warmup_ratio 0.03 \\\n    --lr_scheduler_type \"cosine\" \\\n    --logging_steps 1 \\\n    --fsdp \"full_shard auto_wrap\" \\\n    --fsdp_transformer_layer_cls_to_wrap 'LLaMADecoderLayer' \\\n    --tf32 True\n ```\n \n \nFine-tuning with Lora \n```python\nWORLD_SIZE=6 CUDA_VISIBLE_DEVICES=0,1,2,3,4,5 torchrun --nproc_per_node=6 --master_port=4567 train_lora.py \\\n  --base_model '.\u002Fweights-alpaca\u002F' \\\n  --data_path 'HealthCareMagic-100k.json' \\\n  --output_dir '.\u002Flora_models\u002F' \\\n  --batch_size 32 \\\n  --micro_batch_size 4 \\\n  --num_epochs 1 \\\n  --learning_rate 3e-5 \\\n  --cutoff_len 256 \\\n  --val_set_size 120 \\\n  --adapter_name lora\n ```\n \n ## How to inference\n You can build a ChatDoctor model on your own machine and communicate with it.\n ```python\npython chat.py\n ```\n \n  ```python\ncd Autonomous_ChatDoctor_csv\npython chat_csv.py\n ```\n \n  ```python\ncd Autonomous_ChatDoctor_Wikipedia\npython chat_wiki.py\n ```\n \n## Examples:\nWe fine-tuned our model on HealthCareMagic-100K, and test our model on iCliniq-10k.\n\n```\nPatient question from icliniq: Hi doctor,I am getting one-sided headache. I do not get them often. They are behind my right eye and temple area. Now this time I am also fighting with heavy cold and cough. It came on late morning today and it hurts more when I cough or shake my head or bend over. Prior to this, I had the same headache about four months ago. At that time it came on midafternoon and lasted till next morning. Prior to that, I had the same headache exactly on the right side and lasted for a day. I am on CCB and Protonix. I am scared of brain tumor. Please help\n\nReal doctor answer from icliniq: Hi. Based on what you have told, this is more likely to be due to sinusitis. Sinuses are small air filled cavities in your skull bone. They can get infected and when they are infected, you will get headaches behind eyes. Such headaches will be more common during cold and cough. Brain tumor headache will be on both sides, more in forehead and you will also have vomiting in that case. Based on what you have told, this is more likely due to simple sinus infection instead of brain tumor. CT brain and CT paranasal sinuses.\n\nAnswer form ChatGPT: Hello! I'm sorry to hear you're experiencing these headaches. Based on the location of the pain, it sounds like it may be a tension headache or a migraine. These types of headaches can sometimes be triggered by colds or other illnesses. However, it's always best to get checked out by your doctor to rule out any other underlying conditions. In terms of a brain tumor, that is a very rare cause of headaches. Most people who experience headaches do not have a brain tumor. That being said, if you have any concerning symptoms such as vision changes, weakness, or numbness, it is important to seek medical attention right away. In the meantime, you can try taking over-the-counter pain relievers such as ibuprofen or acetaminophen to help with the headache. It's also important to get plenty of rest and stay hydrated. If the headaches persist or become more frequent, please make an appointment with your doctor. Take care!\n\nAnswer form ChatDoctor: Hi, Thank you for posting your query. First, I would like to reassure you that there is no need to worry about brain tumor. Also, we should keep migraine apart as well. The most likely cause of your headaches could be sinusitis. This can be confirmed by doing an X-ray of face. Treatment would consist of using decongestant tablets\u002F nasal sprays. Best wishes, Chat Doctor.\n```\nChatDoctor accurately mentions sinusitis, which is also present in the real conversation in icliniq.\n\n\n## Overview\nChatDoctor is a next-generation AI doctor model that is based on the [LLaMA](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama) model. The goal of this project is to provide patients with an intelligent and reliable healthcare companion that can answer their medical queries and provide them with personalized medical advice.\n\nThe ChatDoctor is an advanced language model that is specifically designed for medical applications. It has been trained on a large corpus of medical literature and has a deep understanding of medical terminology, procedures, and diagnoses. This model serves as the foundation for ChatDoctor, enabling it to analyze patients' symptoms and medical history, provide accurate diagnoses, and suggest appropriate treatment options.\n\nThe ChatDoctor model is designed to simulate a conversation between a doctor and a patient, using natural language processing (NLP) and machine learning techniques. Patients can interact with the ChatDoctor model through a chat interface, asking questions about their health, symptoms, or medical conditions. The model will then analyze the input and provide a response that is tailored to the patient's unique situation.\n\nOne of the key features of the ChatDoctor model is its ability to learn and adapt over time. As more patients interact with the model, it will continue to refine its responses and improve its accuracy. This means that patients can expect to receive increasingly personalized and accurate medical advice over time.\n\n\n ## Patient-physician Conversation Dataset\u003C\u002Fh2>\nThe first step in fine-tuning is to collect a dataset of patient-physician conversations. In patient-physician conversations, the patient's descriptions of disease symptoms are often colloquial and cursory. If we manually construct the synthesized patient-physician conversation dataset, it often leads to the problem of insufficient diversity and over-specialized descriptions, which are often spaced out from real scenarios. Collecting real patient-physician conversations is a better solution. Therefore, we collected about 100k real doctor-patient conversations from an online medical consultation website HealthCareMagic(www.healthcaremagic.com). We filtered these data both manually and automatically, removed the identity information of the doctor and patient, and used language tools to correct grammatical errors, and we named this dataset HealthCareMagic-100k. In addition, we collected approximately 10k patient-physician conversations from the online medical consultation website iCliniq to evaluate the performance of our model.\n\n\n## Autonomous ChatDoctor based on Knowledge Brain\u003C\u002Fh2>\nEquipped with the external knowledge brain, i.e., Wikipedia or our constructed database encompassing over 700 diseases, ChatDoctor could retrieve the corresponding knowledge and reliable sources to answer patients' inquiries more accurately. After constructing the external knowledge brain, we need to let our ChatDoctor retrieve the knowledge he needs autonomously, which can generally be achieved in a large language model by constructing appropriate prompts. To automate this process, we design keyword mining prompts for ChatDoctor to extract key terms for relevant knowledge seeking. Then, the top-ranked relevant passages were retrieved from Knowledge Brain with a term-matching retrieval system. As for the disease database, since the model cannot read all the data at once, we first let the model read the data in batches and select for itself the data entries that might help answer the patient's question. Finally, all the data entries selected by the model are given to the model for a final answer. This approach better ensures that patients receive well-informed and precise responses backed by credible references.\n\n\n\n## Limitations\nWe emphasize that ChatDoctor is for academic research only and any commercial use and clinical use is prohibited. There are three factors in this decision: First, ChatDoctor is based on LLaMA and has a non-commercial license, so we necessarily inherited this decision. Second, our model is not licensed for healthcare-related purposes. Also, we have not designed sufficient security measures, and the current model still does not guarantee the full correctness of medical diagnoses.\n\n\n\n\n## Reference\n\nChatDoctor: A Medical Chat Model Fine-tuned on LLaMA Model using Medical Domain Knowledge\n\n```\n@article{li2023chatdoctor,\n  title={ChatDoctor: A Medical Chat Model Fine-Tuned on a Large Language Model Meta-AI (LLaMA) Using Medical Domain Knowledge},\n  author={Li, Yunxiang and Li, Zihan and Zhang, Kai and Dan, Ruilong and Jiang, Steve and Zhang, You},\n  journal={Cureus},\n  volume={15},\n  number={6},\n  year={2023},\n  publisher={Cureus}\n}\n```\n\n\n\n\n","\u003Cp align=\"center\" width=\"80%\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKent0n-Li_ChatDoctor_readme_04818da4ab1f.png\" style=\"width: 40%; min-width: 300px; display: block; margin: auto;\">\n\u003C\u002Fp>\n\n\n# [ChatDoctor：基于Meta AI大型语言模型（LLaMA）并结合医学领域知识微调的医疗对话模型](https:\u002F\u002Fwww.cureus.com\u002Farticles\u002F152858-chatdoctor-a-medical-chat-model-fine-tuned-on-a-large-language-model-meta-ai-llama-using-medical-domain-knowledge#!\u002F)\nYunxiang Li\u003Csup>1\u003C\u002Fsup>, Zihan Li\u003Csup>2\u003C\u002Fsup>, Kai Zhang\u003Csup>3\u003C\u002Fsup>, Ruilong Dan\u003Csup>4\u003C\u002Fsup>, Steve Jiang\u003Csup>1\u003C\u002Fsup>, You Zhang\u003Csup>1\u003C\u002Fsup>\n\u003Ch5>1 美国西南医学中心\u003C\u002Fh5>\n\u003Ch5>2 美国内布拉斯加大学林肯分校\u003C\u002Fh5>\n\u003Ch5>3 美国俄亥俄州立大学\u003C\u002Fh5>\n\u003Ch5>4 中国杭州电子科技大学\u003C\u002Fh5>\n\n\n[![许可证](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache_2.0-green.svg)](https:\u002F\u002Fgithub.com\u002FHUANGLIZI\u002FChatDoctor\u002Fblob\u002Fmain\u002FLICENSE) \n[![Python 3.9+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.9+-blue.svg)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002Frelease\u002Fpython-390\u002F) \n[![网页](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWeb-Page-yellow)](https:\u002F\u002Fwww.yunxiangli.top\u002FChatDoctor\u002F) \n## 资源列表\n具备疾病数据库的自主型ChatDoctor [演示](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fkenton-li\u002Fchatdoctor_csv)。\n\n来自HealthCareMagic.com的10万条患者与医生的真实对话 [HealthCareMagic-100k](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1lyfqIwlLSClhgrCutWuEe_IACNq6XNUt\u002Fview?usp=sharing)。\n\n来自icliniq.com的1万条患者与医生的真实对话 [icliniq-10k](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1ZKbqgYqWc7DJHs3N9TQYQVPdDQmZaClA\u002Fview?usp=sharing)。\n\nChatDoctor的检查点，[链接](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F11-qPzz9ZdHD6pc47wBSOUSU61MaDPyRh?usp=sharing)。\n\n用于基础对话能力的斯坦福Alpaca数据。[Alpaca链接](https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fblob\u002Fmain\u002Falpaca_data.json)。\n\n\n\u003Cp align=\"center\" width=\"100%\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKent0n-Li_ChatDoctor_readme_76f937ff4dd0.png\" style=\"width: 70%; min-width: 300px; display: block; margin: auto;\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\" width=\"100%\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKent0n-Li_ChatDoctor_readme_254fc4ff1364.png\" style=\"width: 70%; min-width: 300px; display: block; margin: auto;\">\n\u003C\u002Fp>\n\n\n ## 设置：\n 在已安装PyTorch的conda环境中，运行：\n```\npip install -r requirements.txt\n```\n\n ## 交互式演示页面：\n演示页面：https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fkenton-li\u002Fchatdoctor_csv\n值得注意的是，我们的模型尚未达到100%准确的输出，请勿将其应用于真实的临床场景。\n\n对于想要尝试在线演示的人士，请注册Hugging Face并填写此表格 [链接](https:\u002F\u002Fforms.office.com\u002FPages\u002FResponsePage.aspx?id=lYZBnaxxMUy1ssGWyOw8ij06Cb8qnDJKvu2bVpV1-ANURUU0TllBWVVHUjQ1MDJUNldGTTZWV1c5UC4u)。\n\n ## 数据与模型：\n ### 1. ChatDoctor数据集：\n您可以下载以下训练数据集\n\n来自HealthCareMagic.com的10万条患者与医生的真实对话 [HealthCareMagic-100k](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1lyfqIwlLSClhgrCutWuEe_IACNq6XNUt\u002Fview?usp=sharing)。\n\n来自icliniq.com的1万条患者与医生的真实对话 [icliniq-10k](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1ZKbqgYqWc7DJHs3N9TQYQVPdDQmZaClA\u002Fview?usp=sharing)。\n\n由ChatGPT生成的5千条患者与医生的对话 [GenMedGPT-5k](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1nDTKZ3wZbZWTkFMBkxlamrzbNz0frugg\u002Fview?usp=sharing)以及[疾病数据库](https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fblob\u002Fmain\u002Fformat_dataset.csv)。\n\n我们的模型首先使用斯坦福Alpaca的数据进行微调，以获得一些基础的对话能力。[Alpaca链接](https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fblob\u002Fmain\u002Falpaca_data.json)\n\n ### 2. 模型权重：\n\n将模型权重文件放置在.\u002Fpretrained文件夹中。\n\n ## 微调方法\n\n ```python\ntorchrun --nproc_per_node=4 --master_port=\u003Cyour_random_port> train.py \\\n    --model_name_or_path \u003Cyour_path_to_hf_converted_llama_ckpt_and_tokenizer> \\\n    --data_path .\u002FHealthCareMagic-100k.json \\\n    --bf16 True \\\n    --output_dir pretrained \\\n    --num_train_epochs 1 \\\n    --per_device_train_batch_size 4 \\\n    --per_device_eval_batch_size 4 \\\n    --gradient_accumulation_steps 8 \\\n    --evaluation_strategy \"no\" \\\n    --save_strategy \"steps\" \\\n    --save_steps 2000 \\\n    --save_total_limit 1 \\\n    --learning_rate 2e-6 \\\n    --weight_decay 0. \\\n    --warmup_ratio 0.03 \\\n    --lr_scheduler_type \"cosine\" \\\n    --logging_steps 1 \\\n    --fsdp \"full_shard auto_wrap\" \\\n    --fsdp_transformer_layer_cls_to_wrap 'LLaMADecoderLayer' \\\n    --tf32 True\n ```\n \n \n使用LoRA进行微调\n```python\nWORLD_SIZE=6 CUDA_VISIBLE_DEVICES=0,1,2,3,4,5 torchrun --nproc_per_node=6 --master_port=4567 train_lora.py \\\n  --base_model '.\u002Fweights-alpaca\u002F' \\\n  --data_path 'HealthCareMagic-100k.json' \\\n  --output_dir '.\u002Flora_models\u002F' \\\n  --batch_size 32 \\\n  --micro_batch_size 4 \\\n  --num_epochs 1 \\\n  --learning_rate 3e-5 \\\n  --cutoff_len 256 \\\n  --val_set_size 120 \\\n  --adapter_name lora\n ```\n \n ## 推理方法\n 您可以在自己的机器上构建一个ChatDoctor模型并与之交流。\n ```python\npython chat.py\n ```\n \n  ```python\ncd Autonomous_ChatDoctor_csv\npython chat_csv.py\n ```\n \n  ```python\ncd Autonomous_ChatDoctor_Wikipedia\npython chat_wiki.py\n ```\n\n## 示例：\n我们在 HealthCareMagic-100K 数据集上对模型进行了微调，并在 iCliniq-10k 数据集上测试了该模型。\n\n```\niCliniq 上的患者提问：医生您好，我最近出现单侧头痛。这种情况并不常见。疼痛位于右眼后方和太阳穴附近。这次还伴有严重的感冒和咳嗽。症状今天上午晚些时候开始，咳嗽、摇头或弯腰时疼痛会加剧。大约四个月前我也出现过类似的头痛，当时是在下午中段发作，一直持续到第二天早上。再之前的一次也是右侧头痛，持续了一天。我现在正在服用 CCB 和质子泵抑制剂。我很担心自己得了脑瘤，请您帮忙。\n\niCliniq 上的真实医生回答：您好！根据您的描述，这更可能是鼻窦炎引起的。鼻窦是颅骨内的小空腔，充满空气。当它们感染时，就会引起眼后方的头痛。这种头痛在感冒和咳嗽期间更为常见。而脑瘤引起的头痛通常是双侧的，多见于前额，并且常伴有呕吐。因此，根据您的情况，这更像是普通的鼻窦感染，而非脑瘤。建议进行头部 CT 和鼻窦 CT 检查。\n\nChatGPT 的回答：您好！很抱歉您正在经历这些头痛。从疼痛的位置来看，这可能是紧张性头痛或偏头痛。这类头痛有时会因感冒或其他疾病而诱发。不过，为了排除其他潜在问题，最好还是去看一下医生。至于脑瘤，它导致头痛的情况非常罕见。大多数头痛患者并不会患有脑瘤。当然，如果您出现视力变化、无力或麻木等令人担忧的症状，应立即就医。在此期间，您可以尝试服用一些非处方止痛药，如布洛芬或对乙酰氨基酚来缓解头痛。同时也要注意休息和保持水分充足。如果头痛持续不减或变得更加频繁，请尽快预约医生。祝您早日康复！\n\nChatDoctor 的回答：您好！感谢您的提问。首先，请放心，您不必担心脑瘤的问题。此外，我们也应该排除偏头痛的可能性。您头痛的最可能原因很可能是鼻窦炎。这一点可以通过面部 X 光检查来确认。治疗方案包括使用减充血剂片剂或鼻喷剂。祝您健康！\n```\nChatDoctor 准确提到了鼻窦炎，这一点与 iCliniq 中的真实对话一致。\n\n\n## 概述\nChatDoctor 是一款基于 [LLaMA](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama) 模型的新一代 AI 医生模型。该项目的目标是为患者提供一个智能可靠的医疗助手，能够解答他们的医学疑问并给出个性化的医疗建议。\n\nChatDoctor 是一种专为医疗应用设计的先进语言模型。它接受了大量医学文献的训练，对医学术语、诊疗流程和疾病诊断有着深刻的理解。这一基础使 ChatDoctor 能够分析患者的症状和病史，做出准确的诊断，并提出合适的治疗方案。\n\nChatDoctor 模型通过自然语言处理（NLP）和机器学习技术，模拟医生与患者之间的对话过程。患者可以通过聊天界面与模型互动，询问自己的健康状况、症状或疾病相关问题。模型会根据输入内容，结合患者的具体情况，给出针对性的回答。\n\nChatDoctor 模型的一大特点是其不断学习和自我优化的能力。随着越来越多的患者与模型交互，它的回答将更加精准，准确性也会逐步提升。这意味着患者可以随着时间推移获得越来越个性化和准确的医疗建议。\n\n\n## 患者-医生对话数据集\u003C\u002Fh2>\n微调的第一步是收集患者与医生的对话数据。在真实的医患对话中，患者对病情症状的描述往往较为口语化且简略。如果人工构建合成的医患对话数据集，则容易出现多样性不足、描述过于专业化等问题，从而偏离真实场景。因此，直接收集真实的医患对话数据是一个更好的选择。我们从在线医疗咨询网站 HealthCareMagic（www.healthcaremagic.com）上收集了约 10 万条真实的医患对话记录。随后，我们通过人工和自动化的方式对数据进行了筛选，去除了医生和患者的个人信息，并利用语言工具修正了语法错误，最终将该数据集命名为 HealthCareMagic-100k。此外，我们还从另一家在线医疗咨询网站 iCliniq 收集了约 1 万条医患对话，用于评估模型的表现。\n\n\n## 基于知识库的自主 ChatDoctor\u003C\u002Fh2>\n借助外部知识库——例如维基百科或我们构建的包含 700 多种疾病的数据库——ChatDoctor 可以检索相关信息及可靠来源，从而更准确地回答患者的咨询。在构建好外部知识库后，我们需要让 ChatDoctor 自主获取所需知识。通常，在大型语言模型中，这可以通过设计合适的提示词来实现。为了进一步自动化这一过程，我们为 ChatDoctor 设计了关键词挖掘提示，帮助其提取与查询相关的关键术语。然后，系统会通过词条匹配检索机制，从知识库中提取排名靠前的相关内容。对于疾病数据库而言，由于模型无法一次性读取所有数据，我们先让模型分批读取数据，并自行筛选出可能有助于回答患者问题的数据条目。最后，模型会综合所有筛选出的信息，生成最终答案。这种方法能够更好地确保患者获得有充分依据且精确的回答。\n\n\n## 局限性\n我们强调，ChatDoctor 仅用于学术研究，禁止任何商业用途和临床应用。作出这一决定主要有三个原因：首先，ChatDoctor 基于 LLaMA 模型，而该模型采用非商业许可，因此我们不得不遵循这一限制；其次，我们的模型并未获得医疗相关用途的许可；此外，我们尚未设计足够的安全措施，当前模型仍无法完全保证诊断结果的准确性。\n\n## 参考文献\n\nChatDoctor：基于 LLaMA 模型并结合医学领域知识微调的医疗对话模型\n\n```\n@article{li2023chatdoctor,\n  title={ChatDoctor：基于大型语言模型 Meta-AI (LLaMA) 并结合医学领域知识微调的医疗对话模型},\n  author={李云翔、李子涵、张凯、单瑞龙、江史蒂夫、张友},\n  journal={Cureus},\n  volume={15},\n  number={6},\n  year={2023},\n  publisher={Cureus}\n}\n```","# ChatDoctor 快速上手指南\n\nChatDoctor 是一个基于 LLaMA 大语言模型，利用医学领域知识微调而成的医疗对话模型。本项目旨在为患者提供智能的医疗咨询辅助。**注意：本模型仅供学术研究，严禁用于真实临床诊断或商业用途。**\n\n## 1. 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**: Linux (推荐) 或 macOS\n*   **Python 版本**: 3.9 或更高\n*   **硬件要求**: 需要支持 CUDA 的 NVIDIA GPU（微调过程显存需求较高，推理可根据模型大小调整）\n*   **依赖管理**: 推荐使用 `conda` 创建独立虚拟环境\n\n### 前置依赖安装\n\n首先创建并激活 conda 环境（确保已安装 PyTorch），然后安装项目依赖：\n\n```bash\n# 创建环境 (示例，请根据实际 CUDA 版本安装 pytorch)\nconda create -n chatdoctor python=3.9\nconda activate chatdoctor\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n\n# 安装项目依赖\npip install -r requirements.txt\n```\n\n> **提示**：国内用户可使用清华源或阿里源加速 pip 安装：\n> `pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`\n\n## 2. 模型与数据准备\n\n在运行代码前，您需要下载预训练权重和数据集。\n\n1.  **下载模型权重**：\n    从 [Google Drive 链接](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F11-qPzz9ZdHD6pc47wBSOUSU61MaDPyRh?usp=sharing) 下载 ChatDoctor 的检查点文件。\n    将下载的文件放置在项目根目录下的 `.\u002Fpretrained` 文件夹中。\n\n2.  **下载数据集（可选，仅用于微调）**：\n    *   HealthCareMagic-100k: [下载链接](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1lyfqIwlLSClhgrCutWuEe_IACNq6XNUt\u002Fview?usp=sharing)\n    *   icliniq-10k: [下载链接](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1ZKbqgYqWc7DJHs3N9TQYQVPdDQmZaClA\u002Fview?usp=sharing)\n    *   Stanford Alpaca 数据：[alpaca_data.json](https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fblob\u002Fmain\u002Falpaca_data.json)\n\n## 3. 基本使用（推理演示)\n\n完成环境配置和权重下载后，您可以直接在本地启动对话交互。\n\n### 标准对话模式\n运行以下命令启动基础聊天机器人：\n\n```python\npython chat.py\n```\n\n### 增强知识库模式\n如果您希望模型结合外部知识库（如疾病数据库或维基百科）进行回答，请使用以下命令：\n\n**基于疾病数据库：**\n```python\ncd Autonomous_ChatDoctor_csv\npython chat_csv.py\n```\n\n**基于维基百科知识：**\n```python\ncd Autonomous_ChatDoctor_Wikipedia\npython chat_wiki.py\n```\n\n运行后，终端将进入交互界面，您可以输入患者症状或问题，模型将生成相应的医疗建议回复。\n\n---\n*免责声明：ChatDoctor 的输出可能存在不准确的情况，切勿将其结果作为真实的医疗诊断依据。*","某基层社区卫生服务中心的全科医生，正面临大量患者通过线上渠道咨询常见病症（如感冒、肠胃不适）的初步分诊压力。\n\n### 没有 ChatDoctor 时\n- 医生需反复手动回复大量重复性的基础症状询问，挤占了处理重症患者的宝贵时间。\n- 面对非工作时间的患者留言，无法及时提供专业引导，导致患者焦虑或盲目自行用药。\n- 缺乏统一的医学知识库支撑，不同医生对相似症状的初步建议存在差异，标准化程度低。\n- 整理典型病例用于教学或科研时，人工从海量聊天记录中筛选高质量对话效率极低。\n\n### 使用 ChatDoctor 后\n- ChatDoctor 能基于 10 万 + 真实医患对话数据，自动回答常见病的初步咨询，让医生专注于复杂病例。\n- 提供 7×24 小时的智能预问诊服务，根据患者描述给出就医指引和注意事项，缓解患者等待焦虑。\n- 依托微调后的 LLaMA 模型与疾病数据库，输出符合医学规范的标准化建议，提升服务一致性。\n- 快速生成结构化的模拟医患对话数据，辅助医生高效完成病例库构建与实习生培训素材准备。\n\nChatDoctor 通过将通用大语言模型转化为懂医学的专属助手，有效释放了基层医生的精力并提升了医疗服务的可及性与规范性。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKent0n-Li_ChatDoctor_04818da4.png","Kent0n-Li","Yunxiang Li","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FKent0n-Li_a24dfba3.png","PhD student, UT Southwestern Medical Center","University of Texas Southwestern Medical Center","Dallas","https:\u002F\u002Fgithub.com\u002FKent0n-Li",[85],{"name":86,"color":87,"percentage":88},"Python","#3572A5",100,3628,431,"2026-04-10T04:06:42","Apache-2.0","未说明","必需 NVIDIA GPU。微调示例显示支持多卡并行（--nproc_per_node=4 或 6），并使用 FSDP (full_shard) 策略，暗示需要较大显存。具体型号和显存大小未明确说明，但运行 LLaMA 基座模型通常建议 16GB+ 显存。",{"notes":96,"python":97,"dependencies":98},"1. 必须在包含 PyTorch 的 conda 环境中运行。2. 项目基于 LLaMA 模型，需自行准备转换后的 Hugging Face 格式权重文件并放入 .\u002Fpretrained 目录。3. 提供了全量微调 (train.py) 和 LoRA 微调 (train_lora.py) 两种脚本，后者对显存要求较低。4. 模型仅供学术研究，严禁用于临床或商业用途。5. 推理前需下载约 100k 条医疗对话数据集及预训练权重。","3.9+",[99,100,101,102,103,104,105],"torch","transformers","accelerate","peft (推测用于 LoRA)","datasets","sentencepiece","bitsandbytes (推测用于量化)",[15],"2026-03-27T02:49:30.150509","2026-04-13T13:37:51.160677",[110,115,120,125,130,135],{"id":111,"question_zh":112,"answer_zh":113,"source_url":114},31593,"为什么指令数据以\"If you are a doctor\"开头而不是\"You are a doctor\"？","这是为了确保模型仅在扮演医生角色时受到微调影响。如果将患者描述直接作为指令而非输入，训练后的模型会影响其他任务的对话能力。固定指令为\"If you are a doctor\"并在推理时添加该指令，可以确保模型正常运行且不影响非医疗场景的表现。","https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fissues\u002F10",{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},31594,"运行 chat.py 时报错：AttributeError: module transformers has no attribute LLaMATokenizer，如何解决？","这是因为类名在最新版本中已更改。请将代码中的 `LLaMATokenizer` 修改为 `LlamaTokenizer`，并将 `LlamaForCausalLM` 保持正确引用（注意原评论中提到的一处笔误，实际应检查类名大小写）。同时确保安装了最新版的 transformers：`pip install git+https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftransformers`。","https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fissues\u002F38",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},31595,"可以从头开始训练模型而不使用预训练权重吗？","不可以。该模型必须基于 LLaMA 的预训练权重进行训练，不支持从零开始训练。","https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fissues\u002F24",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},31596,"运行时提示找不到预训练模型文件（model not found in pretrained section），如何获取？","需要填写官方表单申请下载权限。请访问以下链接填写表单以获取检查点（checkpoints）下载资格：https:\u002F\u002Fforms.office.com\u002FPages\u002FResponsePage.aspx?id=lYZBnaxxMUy1ssGWyOw8ij06Cb8qnDJKvu2bVpV1-ANUMDIzWlU0QTUxN0YySFROQk9HMVU0N0xJNC4u","https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fissues\u002F16",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},31597,"运行 train.py 时出现 wandb 错误：api_key not configured，如何解决？","需要先注册 Weights & Biases (wandb) 账号并获取 API Key。然后在代码中调用 `wandb.login(key=[your_api_key])` 或在命令行运行 `wandb login` 进行配置。","https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fissues\u002F15",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},31598,"提供的 Hugging Face Demo 链接无法访问，是否有新的演示地址？","由于团队正在进一步优化模型性能，目前的 Demo 已暂时下线，暂无替代链接可用。","https:\u002F\u002Fgithub.com\u002FKent0n-Li\u002FChatDoctor\u002Fissues\u002F5",[]]