[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-chaoyi-wu--PMC-LLaMA":3,"tool-chaoyi-wu--PMC-LLaMA":61},[4,19,28,37,45,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":18},10095,"AutoGPT","Significant-Gravitas\u002FAutoGPT","AutoGPT 是一个旨在让每个人都能轻松使用和构建 AI 的强大平台，核心功能是帮助用户创建、部署和管理能够自动执行复杂任务的连续型 AI 智能体。它解决了传统 AI 应用中需要频繁人工干预、难以自动化长流程工作的痛点，让用户只需设定目标，AI 即可自主规划步骤、调用工具并持续运行直至完成任务。\n\n无论是开发者、研究人员，还是希望提升工作效率的普通用户，都能从 AutoGPT 中受益。开发者可利用其低代码界面快速定制专属智能体；研究人员能基于开源架构探索多智能体协作机制；而非技术背景用户也可直接选用预置的智能体模板，立即投入实际工作场景。\n\nAutoGPT 的技术亮点在于其模块化“积木式”工作流设计——用户通过连接功能块即可构建复杂逻辑，每个块负责单一动作，灵活且易于调试。同时，平台支持本地自托管与云端部署两种模式，兼顾数据隐私与使用便捷性。配合完善的文档和一键安装脚本，即使是初次接触的用户也能在几分钟内启动自己的第一个 AI 智能体。AutoGPT 正致力于降低 AI 应用门槛，让人人都能成为 AI 的创造者与受益者。",183572,3,"2026-04-20T04:47:55",[13,14,15,16,17],"Agent","语言模型","插件","开发框架","图像","ready",{"id":20,"name":21,"github_repo":22,"description_zh":23,"stars":24,"difficulty_score":25,"last_commit_at":26,"category_tags":27,"status":18},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 真正成长为懂上",161147,2,"2026-04-19T23:31:47",[16,13,14],{"id":29,"name":30,"github_repo":31,"description_zh":32,"stars":33,"difficulty_score":34,"last_commit_at":35,"category_tags":36,"status":18},10072,"DeepSeek-V3","deepseek-ai\u002FDeepSeek-V3","DeepSeek-V3 是一款由深度求索推出的开源混合专家（MoE）大语言模型，旨在以极高的效率提供媲美顶尖闭源模型的智能服务。它拥有 6710 亿总参数，但在处理每个 token 时仅激活 370 亿参数，这种设计巧妙解决了大规模模型推理成本高、速度慢的难题，让高性能 AI 更易于部署和应用。\n\n这款模型特别适合开发者、研究人员以及需要构建复杂 AI 应用的企业团队使用。无论是进行代码生成、逻辑推理还是多轮对话开发，DeepSeek-V3 都能提供强大的支持。其独特之处在于采用了无辅助损失的负载均衡策略和多令牌预测训练目标，前者在提升计算效率的同时避免了性能损耗，后者则显著增强了模型表现并加速了推理过程。此外，模型在 14.8 万亿高质量令牌上完成预训练，且整个训练过程异常稳定，未出现不可恢复的损失尖峰。凭借仅需 278.8 万 H800 GPU 小时即可完成训练的高效特性，DeepSeek-V3 为开源社区树立了一个兼顾性能与成本效益的新标杆。",102693,5,"2026-04-20T03:58:04",[14],{"id":38,"name":39,"github_repo":40,"description_zh":41,"stars":42,"difficulty_score":10,"last_commit_at":43,"category_tags":44,"status":18},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[14,17,13,16],{"id":46,"name":47,"github_repo":48,"description_zh":49,"stars":50,"difficulty_score":25,"last_commit_at":51,"category_tags":52,"status":18},8553,"spec-kit","github\u002Fspec-kit","Spec Kit 是一款专为提升软件开发效率而设计的开源工具包，旨在帮助团队快速落地“规格驱动开发”（Spec-Driven Development）模式。传统开发中，需求文档往往与代码实现脱节，导致沟通成本高且结果不可控；而 Spec Kit 通过将规格说明书转化为可执行的指令，让 AI 直接依据明确的业务场景生成高质量代码，从而减少从零开始的随意编码，确保产出结果的可预测性。\n\n该工具特别适合希望利用 AI 辅助编程的开发者、技术负责人及初创团队。无论是启动全新项目还是在现有工程中引入规范化流程，用户只需通过简单的命令行操作，即可初始化项目并集成主流的 AI 编程助手。其核心技术亮点在于“规格即代码”的理念，支持社区扩展与预设模板，允许用户根据特定技术栈定制开发流程。此外，Spec Kit 强调官方维护的安全性，提供稳定的版本管理，帮助开发者在享受 AI 红利的同时，依然牢牢掌握架构设计的主动权，真正实现从“凭感觉写代码”到“按规格建系统”的转变。",88749,"2026-04-17T09:48:14",[14,17,13,16],{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":25,"last_commit_at":59,"category_tags":60,"status":18},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",[16,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":91,"forks":92,"last_commit_at":93,"license":79,"difficulty_score":10,"env_os":94,"env_gpu":95,"env_ram":96,"env_deps":97,"category_tags":106,"github_topics":79,"view_count":25,"oss_zip_url":79,"oss_zip_packed_at":79,"status":18,"created_at":108,"updated_at":109,"faqs":110,"releases":141},10062,"chaoyi-wu\u002FPMC-LLaMA","PMC-LLaMA","The official codes for \"PMC-LLaMA: Towards Building Open-source Language Models for Medicine\"","PMC-LLaMA 是一个专为医疗领域打造的开源大语言模型项目，旨在构建高质量、可公开使用的医学 AI 助手。它通过两阶段训练策略解决通用模型在专业医疗场景下知识匮乏且指令遵循能力弱的问题：首先利用 480 万篇 PubMed Central 论文及医学书籍进行领域预训练，夯实专业知识基础；随后使用精心构造的指令数据集进行微调，显著提升模型理解医生或患者意图并给出准确回答的能力。\n\n该项目不仅发布了多个版本的模型（如基于 LLaMA-13B 优化的版本），还验证了“先领域预训练、后指令微调”这一技术路线在医疗垂直领域的有效性。相比同类模型，PMC-LLaMA 在处理复杂病例咨询、生成诊断建议等任务时表现更为出色，并能更好地遵循用户的具体指令。此外，团队还推出了针对多语言支持的后续演进版本及专用的医疗报告生成评估指标 RaTEScore，进一步推动了医疗基础模型的发展。\n\nPMC-LLaMA 非常适合医疗 AI 研究人员、开发者以及希望探索大模型在临床辅助决策中应用的专业人士使用。项目提供了完整的代码库、环境配置指南及便捷的加载示例，支持研究者快速复现实验或基于此开发定制化的医疗问答系统","PMC-LLaMA 是一个专为医疗领域打造的开源大语言模型项目，旨在构建高质量、可公开使用的医学 AI 助手。它通过两阶段训练策略解决通用模型在专业医疗场景下知识匮乏且指令遵循能力弱的问题：首先利用 480 万篇 PubMed Central 论文及医学书籍进行领域预训练，夯实专业知识基础；随后使用精心构造的指令数据集进行微调，显著提升模型理解医生或患者意图并给出准确回答的能力。\n\n该项目不仅发布了多个版本的模型（如基于 LLaMA-13B 优化的版本），还验证了“先领域预训练、后指令微调”这一技术路线在医疗垂直领域的有效性。相比同类模型，PMC-LLaMA 在处理复杂病例咨询、生成诊断建议等任务时表现更为出色，并能更好地遵循用户的具体指令。此外，团队还推出了针对多语言支持的后续演进版本及专用的医疗报告生成评估指标 RaTEScore，进一步推动了医疗基础模型的发展。\n\nPMC-LLaMA 非常适合医疗 AI 研究人员、开发者以及希望探索大模型在临床辅助决策中应用的专业人士使用。项目提供了完整的代码库、环境配置指南及便捷的加载示例，支持研究者快速复现实验或基于此开发定制化的医疗问答系统，是进入智慧医疗领域的重要开源基石。","# PMC-LLaMA\n\nThe official codes for \"PMC-LLaMA: Towards Building Open-source Language Models for Medicine\". \n\n\u003C!-- vim-markdown-toc GFM -->\n\n* [Latest News](#latest-news)\n* [Environment](#environment)\n* [Quick Start](#quick-start)\n* [Training](#training)\n* [Results](#results)\n    * [QA Benchmark](#qa-benchmark)\n    * [Zero-shot Cases](#zero-shot-cases)\n* [Acknowledge](#acknowledge)\n* [Contact](#contact)\n\n\u003C!-- vim-markdown-toc -->\n\n[**Arxiv Version**](https:\u002F\u002Farxiv.org\u002Fabs\u002F2304.14454)\n\nWe prove that medical LLM should be first pretrained with domain corpus, and then tuned with instructions following dataset.\n\nWe have released The latest model **PMC_LLaMA_13B** finetuned on our instructions the following dataset.\nIt has shown a better ability to follow user instructions than MedLLaMA_13B.\n\n\u003Cimg src=.\u002Ffigures\u002Fteaser.png width=\"50%\">\n\nSimilarly, it can be easily loaded with:\n\n```python\nimport transformers\nimport torch\ntokenizer = transformers.LlamaTokenizer.from_pretrained('axiong\u002FPMC_LLaMA_13B')\nmodel = transformers.LlamaForCausalLM.from_pretrained('axiong\u002FPMC_LLaMA_13B')\n```\nHereby we present PMC_LLaMA's versions and briefs.\n\n[MedLLaMA_13B](https:\u002F\u002Fhuggingface.co\u002Fchaoyi-wu\u002FMedLLaMA_13B) is pretrained on medical corpus, and [PMC_LLaMA_13B](https:\u002F\u002Fhuggingface.co\u002Faxiong\u002FPMC_LLaMA_13B) is further finetuned based on that.\n\n| Version | Link | Brief | Release Date |\n| --- | --- | --- | --- |\n|MMed-Llama-3 ![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fchaoyi-wu_PMC-LLaMA_readme_7e80f61b0eeb.gif) | https:\u002F\u002Fhuggingface.co\u002FHenrychur\u002FMMed-Llama-3-8B | Latest Pretrained Multilingual LLM on Llama-3 | 2024\u002F05\u002F22 |\n| MMedLM  | https:\u002F\u002Fgithub.com\u002FMAGIC-AI4Med\u002FMMedLM | Further Pretrained Multilingual LLM | 2024\u002F02\u002F21 |\n| PMC_LLaMA_13B | https:\u002F\u002Fhuggingface.co\u002Faxiong\u002FPMC_LLaMA_13B | Instruction Tuned | 2023\u002F09\u002F01 |\n| MedLLaMA_13B | https:\u002F\u002Fhuggingface.co\u002Fchaoyi-wu\u002FMedLLaMA_13B | Pre-training LLaMA on 4.8M PubmedCentral papers and Medical Books | 2023\u002F05\u002F01 |\n| PMC_LLaMA_7B_10_epoch | https:\u002F\u002Fhuggingface.co\u002Fchaoyi-wu\u002FPMC_LLAMA_7B_10_epoch | Similar to PMC_LLaMA_7B but trained 10 epochs | 2023\u002F05\u002F01 |\n| PMC_LLaMA_7B | https:\u002F\u002Fhuggingface.co\u002Fchaoyi-wu\u002FPMC_LLAMA_7B | LLaMA-7b finetuned with PMC papers for 5 epochs | 2023\u002F04\u002F25 |\n\n\n## Latest News\nWe have released a new report genration metrics [RaTEScore](https:\u002F\u002Farxiv.org\u002Fabs\u002F2406.16845). We strongly believe to promote the develop a generative-based medical foundation models, developing a robust and reliable metric is a critical and foundation step. \n\n## Environment\nSimply set up the required environment as following:\n```bash\nconda install pytorch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 pytorch-cuda=11.6 -c pytorch -c nvidia\npip install transformers=4.28.1, sentencepiece, datasets\n```\n\n## Quick Start\nCheck `simple_test.py` for quickly use PMC-LLaMA or you can follow this folowing simple sample.\n\n```python\nimport transformers\nimport torch\ntokenizer = transformers.LlamaTokenizer.from_pretrained('axiong\u002FPMC_LLaMA_13B')\nmodel = transformers.LlamaForCausalLM.from_pretrained('axiong\u002FPMC_LLaMA_13B')\nmodel.cuda()  # move the model to GPU\n\nprompt_input = (\n    'Below is an instruction that describes a task, paired with an input that provides further context.'\n    'Write a response that appropriately completes the request.\\n\\n'\n    '### Instruction:\\n{instruction}\\n\\n### Input:\\n{input}\\n\\n### Response:'\n)\n\nexample = {\n    \"instruction\": \"You're a doctor, kindly address the medical queries according to the patient's account. Answer with the best option directly.\",\n    \"input\": (\n        \"###Question: A 23-year-old pregnant woman at 22 weeks gestation presents with burning upon urination. \"\n        \"She states it started 1 day ago and has been worsening despite drinking more water and taking cranberry extract. \"\n        \"She otherwise feels well and is followed by a doctor for her pregnancy. \"\n        \"Her temperature is 97.7°F (36.5°C), blood pressure is 122\u002F77 mmHg, pulse is 80\u002Fmin, respirations are 19\u002Fmin, and oxygen saturation is 98% on room air.\"\n        \"Physical exam is notable for an absence of costovertebral angle tenderness and a gravid uterus. \"\n        \"Which of the following is the best treatment for this patient?\"\n        \"###Options: A. Ampicillin B. Ceftriaxone C. Doxycycline D. Nitrofurantoin\"\n    )\n}\ninput_str = [prompt_input.format_map(example)]\n\nmodel_inputs = tokenizer(\n    input_str,\n    return_tensors='pt',\n    padding=True,\n)\nprint( f\"\\033[32mmodel_inputs\\033[0m: { model_inputs }\" )\n\n\ntopk_output = model.generate(\n    model_inputs.input_ids.cuda(),\n    max_new_tokens=1000,\n    top_k=50\n)\noutput_str = tokenizer.batch_decode(topk_output)\nprint('model predict: ', output_str[0])\n```\n\n\n## Training\n\nThe training process can be divided as two phases: pretrain and instruction-tuning.\n\n**Pre-training**\n\nThe script for pretraining locates at `Pretrain\u002Ftraining.sh`.\n\nOur pretraining dataset sources from [S2ORC](https:\u002F\u002Fgithub.com\u002Fallenai\u002Fs2orc). Only those papers with PubMed IDs are deemed as medical-related and used during pretraining.\n\u003C!-- The raw training data can be dowloaded from [S2ORC](https:\u002F\u002Fgithub.com\u002Fallenai\u002Fs2orc), filter out the papers with PubmedCentral IDs, and you can get the training data we use.  -->\n\nThe book is listed in this repo as [MedicalBook.xlsx](https:\u002F\u002Fgithub.com\u002Fchaoyi-wu\u002FPMC-LLaMA\u002Fblob\u002Fmain\u002FMedicalBook.xlsx), due to licenses, we cannot release raw content. For reproducing, pls buy and process the books.\n\nMore details about how to fine-tune LLaMA can refer to [Finetune_LLAMA](https:\u002F\u002Fgithub.com\u002Fchaoyi-wu\u002FFinetune_LLAMA)\n\n\n**Instruction Tuning**\n\nWe also provide instruction tuning script at `SFT\u002Ftrain.py`.\nAnd you can find our instruction dataset at [PMC LLaMA Instructions](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Faxiong\u002Fpmc_llama_instructions).\n\n\n## Results\n\n### QA Benchmark\n| Method              | Model Size          | USMLE | MedMCQA | PubMedQA |\n|---------------------|---------------------|------------------|--------------|------------------|\n| Human (pass)        | -                   | 50.0            | --            | 60.0           |\n| Human (expert)      | -                   | 87.0            | 90.0         | 78.0           |\n| ChatGPT             | 175B                | **57.0**        | 44.7         | 63.9           |\n| LLaMA-2             | 13B                 | 42.73           | 37.41        | 68.0           |\n| LLaMA-2             | 70B                 | 43.68           | 35.02        | 74.3           |\n| Med-Alpaca          | 13B                 | 30.85           | 31.13        | 53.2           |\n| Chat-Doctor         | 7B                  | 33.93           | 31.10        | 54.3           |\n| PMC_LLaMA_13B ![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fchaoyi-wu_PMC-LLaMA_readme_7e80f61b0eeb.gif) | 13B | **56.36**   | **56.04**  | **77.9**  |\n\n\nNote that, the manual and zero-shot results with * are referred from [LMFLow](https:\u002F\u002Fgithub.com\u002FOptimalScale\u002FLMFlow\u002Ftree\u002Fmain\u002Fsrc\u002Flmflow).\n\n\n### Zero-shot Cases\n\nWe demonstrate PMC_LLaMA_13B's responses with out of domain queries.\n\n\u003Cimg src=.\u002Ffigures\u002Fpmc_llama_cases.png>\n\nNote that, due to train on the papers, MedLLaMA_13B may generate some citation numbers (LLaMA somtimes will do this as well) and we dismiss them in the cases to show the main contents.\nWhile for PMC_LLaMA_13B, it's much easier to extract the correct answer as the output result is structured.\n\n\n## Acknowledge\nMinimal LLaMA -- https:\u002F\u002Fgithub.com\u002Fzphang\u002Fminimal-llama\n\nalpaca -- https:\u002F\u002Fgithub.com\u002Ftatsu-lab\u002Fstanford_alpaca\n\nLMFLow -- https:\u002F\u002Fgithub.com\u002FOptimalScale\u002FLMFlow\u002Ftree\u002Fmain\u002Fsrc\u002Flmflow\n\nLLaMA: Open and Efficient Foundation Language Models -- https:\u002F\u002Farxiv.org\u002Fabs\u002F2302.13971\n\n## Contact\nIf you have any question, please feel free to contact wtzxxxwcy02@sjtu.edu.cn.\n\n","# PMC-LLaMA\n\n“PMC-LLaMA：迈向构建开源医学语言模型”的官方代码。\n\n\u003C!-- vim-markdown-toc GFM -->\n\n* [最新消息](#latest-news)\n* [环境配置](#environment)\n* [快速入门](#quick-start)\n* [训练](#training)\n* [结果](#results)\n    * [问答基准测试](#qa-benchmark)\n    * [零样本案例](#zero-shot-cases)\n* [致谢](#acknowledge)\n* [联系方式](#contact)\n\n\u003C!-- vim-markdown-toc -->\n\n[**Arxiv版本**](https:\u002F\u002Farxiv.org\u002Fabs\u002F2304.14454)\n\n我们证明，医学大语言模型应首先使用领域语料库进行预训练，然后再使用指令微调数据集进行微调。\n\n我们已发布了基于我们的指令微调数据集训练的最新模型 **PMC_LLaMA_13B**。与 MedLLaMA_13B 相比，它在遵循用户指令方面表现出更强的能力。\n\n\u003Cimg src=.\u002Ffigures\u002Fteaser.png width=\"50%\">\n\n同样，可以轻松加载该模型：\n\n```python\nimport transformers\nimport torch\ntokenizer = transformers.LlamaTokenizer.from_pretrained('axiong\u002FPMC_LLaMA_13B')\nmodel = transformers.LlamaForCausalLM.from_pretrained('axiong\u002FPMC_LLaMA_13B')\n```\n在此，我们介绍 PMC_LLaMA 的各个版本及其简要说明。\n\n[MedLLaMA_13B](https:\u002F\u002Fhuggingface.co\u002Fchaoyi-wu\u002FMedLLaMA_13B) 是在医学语料库上预训练的模型，而 [PMC_LLaMA_13B](https:\u002F\u002Fhuggingface.co\u002Faxiong\u002FPMC_LLaMA_13B) 则是在此基础上进一步微调得到的。\n\n| 版本 | 链接 | 简介 | 发布日期 |\n| --- | --- | --- | --- |\n|MMed-Llama-3 ![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fchaoyi-wu_PMC-LLaMA_readme_7e80f61b0eeb.gif) | https:\u002F\u002Fhuggingface.co\u002FHenrychur\u002FMMed-Llama-3-8B | 基于 Llama-3 的最新多语言预训练大语言模型 | 2024\u002F05\u002F22 |\n| MMedLM  | https:\u002F\u002Fgithub.com\u002FMAGIC-AI4Med\u002FMMedLM | 进一步预训练的多语言大语言模型 | 2024\u002F02\u002F21 |\n| PMC_LLaMA_13B | https:\u002F\u002Fhuggingface.co\u002Faxiong\u002FPMC_LLaMA_13B | 指令微调版 | 2023\u002F09\u002F01 |\n| MedLLaMA_13B | https:\u002F\u002Fhuggingface.co\u002Fchaoyi-wu\u002FMedLLaMA_13B | 在 480 万篇 PubMedCentral 论文和医学书籍上对 LLaMA 进行预训练 | 2023\u002F05\u002F01 |\n| PMC_LLaMA_7B_10_epoch | https:\u002F\u002Fhuggingface.co\u002Fchaoyi-wu\u002FPMC_LLAMA_7B_10_epoch | 类似于 PMC_LLaMA_7B，但训练了 10 个 epoch | 2023\u002F05\u002F01 |\n| PMC_LLaMA_7B | https:\u002F\u002Fhuggingface.co\u002Fchaoyi-wu\u002FPMC_LLAMA_7B | 使用 PMC 论文对 LLaMA-7b 进行 5 个 epoch 的微调 | 2023\u002F04\u002F25 |\n\n\n## 最新消息\n我们发布了一项新的报告生成指标 [RaTEScore](https:\u002F\u002Farxiv.org\u002Fabs\u002F2406.16845)。我们坚信，为了推动基于生成式技术的医学基础模型的发展，开发一个稳健可靠的评估指标是至关重要的基础步骤。\n\n## 环境配置\n只需按照以下步骤设置所需的环境：\n```bash\nconda install pytorch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 pytorch-cuda=11.6 -c pytorch -c nvidia\npip install transformers=4.28.1, sentencepiece, datasets\n```\n\n## 快速入门\n请查看 `simple_test.py` 以快速使用 PMC-LLaMA，或者您可以按照以下简单示例操作。\n\n```python\nimport transformers\nimport torch\ntokenizer = transformers.LlamaTokenizer.from_pretrained('axiong\u002FPMC_LLaMA_13B')\nmodel = transformers.LlamaForCausalLM.from_pretrained('axiong\u002FPMC_LLaMA_13B')\nmodel.cuda()  # 将模型移动到 GPU\n\nprompt_input = (\n    'Below is an instruction that describes a task, paired with an input that provides further context.'\n    'Write a response that appropriately completes the request.\\n\\n'\n    '### Instruction:\\n{instruction}\\n\\n### Input:\\n{input}\\n\\n### Response:'\n)\n\nexample = {\n    \"instruction\": \"您是一位医生，请根据患者的描述回答其医疗问题。直接给出最佳选项。\",\n    \"input\": (\n        \"###问题：一位怀孕 22 周的 23 岁女性主诉排尿时有烧灼感。她表示症状始于 1 天前，并且尽管多喝水和服用蔓越莓提取物，症状仍在加重。她目前总体感觉良好，正在接受产科医生的定期随访。体温为 97.7°F (36.5°C)，血压为 122\u002F77 mmHg，脉搏为 80\u002Fmin，呼吸频率为 19\u002Fmin，室温下血氧饱和度为 98%。体格检查未见肋脊角压痛，子宫呈妊娠状态。请问对该患者的最佳治疗方案是什么？\"\n        \"###选项：A. 氨苄西林 B. 头孢曲松 C. 多西环素 D. 硝呋antoin\"\n    )\n}\ninput_str = [prompt_input.format_map(example)]\n\nmodel_inputs = tokenizer(\n    input_str,\n    return_tensors='pt',\n    padding=True,\n)\nprint( f\"\\033[32mmodel_inputs\\033[0m: { model_inputs }\" )\n\n\ntopk_output = model.generate(\n    model_inputs.input_ids.cuda(),\n    max_new_tokens=1000,\n    top_k=50\n)\noutput_str = tokenizer.batch_decode(topk_output)\nprint('模型预测: ', output_str[0])\n```\n\n\n## 训练\n\n训练过程可分为两个阶段：预训练和指令微调。\n\n**预训练**\n\n预训练脚本位于 `Pretrain\u002Ftraining.sh`。\n\n我们的预训练数据来源于 [S2ORC](https:\u002F\u002Fgithub.com\u002Fallenai\u002Fs2orc)。只有带有 PubMed ID 的论文才被视为与医学相关，并在预训练中使用。\n\u003C!-- 原始训练数据可以从 [S2ORC](https:\u002F\u002Fgithub.com\u002Fallenai\u002Fs2orc) 下载，筛选出带有 PubmedCentral ID 的论文，即可得到我们使用的训练数据。 -->\n\n由于版权限制，我们无法公开原始内容，因此本书以 [MedicalBook.xlsx](https:\u002F\u002Fgithub.com\u002Fchaoyi-wu\u002FPMC-LLaMA\u002Fblob\u002Fmain\u002FMedicalBook.xlsx) 的形式列在本仓库中。如需复现，请自行购买并处理这些书籍。\n\n有关如何微调 LLaMA 的更多详细信息，请参阅 [Finetune_LLAMA](https:\u002F\u002Fgithub.com\u002Fchaoyi-wu\u002FFinetune_LLAMA)\n\n\n**指令微调**\n\n我们还提供了指令微调脚本 `SFT\u002Ftrain.py`。\n您的指令数据集可以在 [PMC LLaMA Instructions](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Faxiong\u002Fpmc_llama_instructions) 中找到。\n\n## 结果\n\n### QA 基准测试\n| 方法              | 模型大小          | USMLE | MedMCQA | PubMedQA |\n|---------------------|---------------------|------------------|--------------|------------------|\n| 人类（及格）        | -                   | 50.0            | --            | 60.0           |\n| 人类（专家）      | -                   | 87.0            | 90.0         | 78.0           |\n| ChatGPT             | 175B                | **57.0**        | 44.7         | 63.9           |\n| LLaMA-2             | 13B                 | 42.73           | 37.41        | 68.0           |\n| LLaMA-2             | 70B                 | 43.68           | 35.02        | 74.3           |\n| Med-Alpaca          | 13B                 | 30.85           | 31.13        | 53.2           |\n| Chat-Doctor         | 7B                  | 33.93           | 31.10        | 54.3           |\n| PMC_LLaMA_13B ![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fchaoyi-wu_PMC-LLaMA_readme_7e80f61b0eeb.gif) | 13B | **56.36**   | **56.04**  | **77.9**  |\n\n\n请注意，手动评分和零样本结果中标有 * 的数据来自 [LMFLow](https:\u002F\u002Fgithub.com\u002FOptimalScale\u002FLMFlow\u002Ftree\u002Fmain\u002Fsrc\u002Flmflow)。\n\n### 零样本案例\n\n我们展示了PMC_LLaMA_13B在域外查询下的响应。\n\n\u003Cimg src=.\u002Ffigures\u002Fpmc_llama_cases.png>\n\n请注意，由于MedLLaMA_13B是在论文数据上训练的，它可能会生成一些引用编号（LLaMA有时也会这样做），我们在案例中将其忽略，以突出主要内容。而对于PMC_LLaMA_13B，由于其输出结果是结构化的，因此更容易提取出正确的答案。\n\n\n## 致谢\nMinimal LLaMA -- https:\u002F\u002Fgithub.com\u002Fzphang\u002Fminimal-llama\n\nalpaca -- https:\u002F\u002Fgithub.com\u002Ftatsu-lab\u002Fstanford_alpaca\n\nLMFLow -- https:\u002F\u002Fgithub.com\u002FOptimalScale\u002FLMFlow\u002Ftree\u002Fmain\u002Fsrc\u002Flmflow\n\nLLaMA：开放且高效的通用语言模型 -- https:\u002F\u002Farxiv.org\u002Fabs\u002F2302.13971\n\n## 联系方式\n如有任何问题，请随时联系 wtzxxxwcy02@sjtu.edu.cn。","# PMC-LLaMA 快速上手指南\n\nPMC-LLaMA 是一个面向医学领域的开源大语言模型。该项目证明了医学大模型应先在领域语料上进行预训练，再使用指令数据集进行微调。本指南将帮助您快速部署并使用最新的 **PMC_LLaMA_13B** 模型。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n- **操作系统**: Linux (推荐)\n- **GPU**: 支持 CUDA 的 NVIDIA 显卡（运行 13B 模型建议显存 ≥ 24GB，或使用量化版本）\n- **Python**: 3.8+\n- **包管理器**: Conda (推荐)\n\n## 安装步骤\n\n### 1. 创建并激活 Conda 环境\n```bash\nconda create -n pmc_llama python=3.9 -y\nconda activate pmc_llama\n```\n\n### 2. 安装 PyTorch 及依赖\n根据官方要求安装特定版本的 PyTorch (CUDA 11.6) 和其他必要库：\n\n```bash\nconda install pytorch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 pytorch-cuda=11.6 -c pytorch -c nvidia\npip install transformers==4.28.1 sentencepiece datasets\n```\n\n> **提示**：如果下载速度较慢，可尝试使用清华或阿里镜像源加速 pip 安装：\n> `pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple transformers==4.28.1 sentencepiece datasets`\n\n## 基本使用\n\n以下是最简单的推理示例，展示如何加载 `PMC_LLaMA_13B` 模型并进行医学问答。\n\n### 代码示例\n\n```python\nimport transformers\nimport torch\n\n# 1. 加载分词器和模型\ntokenizer = transformers.LlamaTokenizer.from_pretrained('axiong\u002FPMC_LLaMA_13B')\nmodel = transformers.LlamaForCausalLM.from_pretrained('axiong\u002FPMC_LLaMA_13B')\nmodel.cuda()  # 将模型移动到 GPU\n\n# 2. 构建输入提示模板\nprompt_input = (\n    'Below is an instruction that describes a task, paired with an input that provides further context.'\n    'Write a response that appropriately completes the request.\\n\\n'\n    '### Instruction:\\n{instruction}\\n\\n### Input:\\n{input}\\n\\n### Response:'\n)\n\n# 3. 准备测试数据 (医学选择题)\nexample = {\n    \"instruction\": \"You're a doctor, kindly address the medical queries according to the patient's account. Answer with the best option directly.\",\n    \"input\": (\n        \"###Question: A 23-year-old pregnant woman at 22 weeks gestation presents with burning upon urination. \"\n        \"She states it started 1 day ago and has been worsening despite drinking more water and taking cranberry extract. \"\n        \"She otherwise feels well and is followed by a doctor for her pregnancy. \"\n        \"Her temperature is 97.7°F (36.5°C), blood pressure is 122\u002F77 mmHg, pulse is 80\u002Fmin, respirations are 19\u002Fmin, and oxygen saturation is 98% on room air.\"\n        \"Physical exam is notable for an absence of costovertebral angle tenderness and a gravid uterus. \"\n        \"Which of the following is the best treatment for this patient?\"\n        \"###Options: A. Ampicillin B. Ceftriaxone C. Doxycycline D. Nitrofurantoin\"\n    )\n}\n\n# 格式化输入\ninput_str = [prompt_input.format_map(example)]\n\n# 4.  Tokenize 输入\nmodel_inputs = tokenizer(\n    input_str,\n    return_tensors='pt',\n    padding=True,\n)\n\n# 5. 生成回答\ntopk_output = model.generate(\n    model_inputs.input_ids.cuda(),\n    max_new_tokens=1000,\n    top_k=50\n)\n\n# 解码并打印结果\noutput_str = tokenizer.batch_decode(topk_output)\nprint('Model Prediction:', output_str[0])\n```\n\n### 运行说明\n1. 将上述代码保存为 `test_pmc.py`。\n2. 确保已登录 Hugging Face (如果模型需要访问权限) 或直接运行（该模型目前公开可用）。\n3. 执行脚本：`python test_pmc.py`。\n4. 模型将输出针对该病例的最佳治疗选项建议。","某三甲医院的信息科团队正致力于开发一款辅助分诊系统，旨在帮助初级医生快速处理海量的患者主诉并生成初步的诊疗建议。\n\n### 没有 PMC-LLaMA 时\n- **通用模型幻觉严重**：直接使用通用的 LLaMA 模型回答专业医学问题时，常出现“一本正经胡说八道”的现象，如编造不存在的药物相互作用或错误的解剖学知识。\n- **术语理解偏差**：模型无法准确识别复杂的临床缩写和生僻医学术语（如特定孕周的并发症描述），导致对病情的理解浮于表面。\n- **指令遵循能力弱**：即使输入了详细的患者病历，模型往往忽略“直接给出最佳选项”等关键约束，输出冗长且缺乏重点的科普文章而非临床建议。\n- **合规风险高**：由于缺乏医学语料的预训练，生成的建议缺乏循证医学依据，难以通过医院内部的伦理与安全审查。\n\n### 使用 PMC-LLaMA 后\n- **专业知识精准可靠**：PMC-LLaMA 基于 480 万篇 PubMed Central 论文及医学书籍预训练，能准确引用权威文献，显著降低医疗幻觉，确保建议的科学性。\n- **深度理解临床语境**：模型能精准解析如\"22 周妊娠伴尿痛”等复杂病例细节，正确关联妊娠期用药禁忌与感染特征，提供符合临床逻辑的分析。\n- **严格遵循诊疗指令**：经过指令微调（Instruction Tuned），PMC-LLaMA 能严格执行“扮演医生”、“直接给出最佳选项”等要求，输出结构清晰、决策导向明确的回复。\n- **落地部署更安心**：作为开源模型，医院可在本地私有化部署，既利用了其在医学领域的专业能力，又确保了患者数据的隐私安全与合规性。\n\nPMC-LLaMA 通过将海量医学文献知识转化为可执行的指令跟随能力，让 AI 真正从“泛泛而谈的聊天机器人”进化为“懂行且守规的医疗助手”。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fchaoyi-wu_PMC-LLaMA_855a78d1.png","chaoyi-wu","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fchaoyi-wu_add1872f.jpg","I am an an Assistant Professor working on medical image analysis and machine learning at Shanghai Jiao Tong University.","Shanghai Jiao Tong University Shanghai","Shanghai","wtzxxxwcy02@sjtu.edu.cn",null,"https:\u002F\u002Fchaoyi-wu.github.io\u002F","https:\u002F\u002Fgithub.com\u002Fchaoyi-wu",[83,87],{"name":84,"color":85,"percentage":86},"Python","#3572A5",97.2,{"name":88,"color":89,"percentage":90},"Shell","#89e051",2.8,676,60,"2026-04-09T08:32:44","未说明","需要 NVIDIA GPU (代码示例使用 .cuda())，CUDA 11.6","未说明 (运行 13B 模型通常建议 24GB+ 显存及充足系统内存)",{"notes":98,"python":94,"dependencies":99},"环境需通过 conda 安装 PyTorch 1.13.0 和 CUDA 11.6。模型基于 LLaMA 架构，提供 7B 和 13B 版本，其中 13B 版本经过指令微调。预训练数据源自 S2ORC（含 PubMed ID 的论文）和部分医学书籍（因版权未开源原始内容）。",[100,101,102,103,104,105],"pytorch==1.13.0","torchvision==0.14.0","torchaudio==0.13.0","transformers==4.28.1","sentencepiece","datasets",[14,107],"其他","2026-03-27T02:49:30.150509","2026-04-20T17:01:48.695782",[111,116,121,126,131,136],{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},45209,"如何在 Google Colab 中运行 PMC-LLaMA 模型？遇到 'NoneType' object is not callable 错误怎么办？","出现该错误通常是因为使用了不兼容的 transformers 版本。新版本移除了 LlamaTokenizer 模块，导致返回 None。请确保安装推荐的 transformers 版本 (4.28.1)：\n!pip install transformers==4.28.1\n此外，由于资源限制，即使是 7B 模型在 Colab 上也难以直接运行，团队正在尝试量化模型以支持 Colab 部署。","https:\u002F\u002Fgithub.com\u002Fchaoyi-wu\u002FPMC-LLaMA\u002Fissues\u002F7",{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},45210,"PMC-LLaMA 的预训练任务（Training Objective）是什么？是预测最后一个 token 还是每个 token？","预训练任务是预测每个 token。虽然代码实现基于 Hugging Face transformers，看起来像是只预测最后一个 token，但实际上利用了其内部机制：每个 token 都会错位计算 loss（shifted labels）。具体可参考 transformers 库中 Llama 模型的实现代码（Line 704-714），这是一种标准的因果语言建模（Causal Language Modeling）方式。","https:\u002F\u002Fgithub.com\u002Fchaoyi-wu\u002FPMC-LLaMA\u002Fissues\u002F4",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},45211,"在哪里可以获取 PMC-LLaMA 的预训练和微调（SFT）数据集？","论文中详细描述了预训练和 SFT 数据的构建过程，相关数据集已开源并在 HuggingFace 上托管。您可以访问以下地址下载：\nhttps:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Faxiong\u002Fpmc_llama_instructions","https:\u002F\u002Fgithub.com\u002Fchaoyi-wu\u002FPMC-LLaMA\u002Fissues\u002F9",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},45212,"如何使用自己的问答数据集对 PMC-LLaMA 进行微调？","项目代码已更新，支持用户在自定义的 QA 数据集上对 PMC-LLaMA 进行微调。请拉取最新代码，并按照仓库中的说明准备您的数据集格式即可开始训练。","https:\u002F\u002Fgithub.com\u002Fchaoyi-wu\u002FPMC-LLaMA\u002Fissues\u002F6",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},45213,"使用模型时是否有推荐的 System Prompt 或对话模板？","是的，不合适的提示词（Prompt）会导致模型表现不佳。开发团队正在适配 FastChat 的对话模板以确保一致性。建议参考 FastChat 的 conversation.py 文件中的模板格式，或者关注项目 Demo 中更新的输入 Prompt，使其行为与论文描述保持一致。","https:\u002F\u002Fgithub.com\u002Fchaoyi-wu\u002FPMC-LLaMA\u002Fissues\u002F14",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},45214,"预训练阶段的 Loss 下降异常（如从 8.0 快速降至 0.2）且效果不明显，可能是什么原因？","这种情况通常是由数据处理问题引起的。正常的 Loss 曲线应类似原始 LLaMA 论文（从 2.0 左右开始下降）。如果遇到 Loss 异常快速下降且模型效果无提升，请检查数据预处理流程，特别是标签和输入的对应关系是否正确。开发者曾确认修复数据处理问题后 Loss 恢复正常。","https:\u002F\u002Fgithub.com\u002Fchaoyi-wu\u002FPMC-LLaMA\u002Fissues\u002F2",[]]