[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-InternLM--InternLM":3,"tool-InternLM--InternLM":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},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 真正成长为懂上",143909,2,"2026-04-07T11:33:18",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},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",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":64,"owner_name":64,"owner_avatar_url":72,"owner_bio":73,"owner_company":74,"owner_location":74,"owner_email":75,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":84,"forks":85,"last_commit_at":86,"license":87,"difficulty_score":10,"env_os":88,"env_gpu":89,"env_ram":88,"env_deps":90,"category_tags":96,"github_topics":97,"view_count":32,"oss_zip_url":74,"oss_zip_packed_at":74,"status":17,"created_at":108,"updated_at":109,"faqs":110,"releases":141},5249,"InternLM\u002FInternLM","InternLM","Official release of InternLM series (InternLM, InternLM2, InternLM2.5, InternLM3).","InternLM 是由上海人工智能实验室推出的一系列开源大语言模型，涵盖从初代到最新的 InternLM3 等多个版本。它旨在为通用场景提供强大的语言理解与生成能力，特别擅长处理复杂的逻辑推理和知识密集型任务。\n\n针对大模型训练成本高、推理效率低的痛点，InternLM3 展现了卓越的性能优势。仅使用 4 万亿高质量令牌进行训练，其成本比同规模模型降低了 75% 以上，却在推理能力上超越了 Llama3.1-8B 和 Qwen2.5-7B 等主流模型。此外，InternLM3 创新性地支持“深度思考”模式，能够通过长思维链解决复杂难题，同时也具备流畅的正常对话模式，兼顾了深度分析与日常交互的需求。\n\n这款工具非常适合 AI 研究人员、开发者以及需要构建智能应用的企业团队使用。无论是希望低成本部署高性能模型的技术人员，还是致力于探索大模型推理机制的学者，都能从中获益。普通用户也可以通过其在线聊天界面体验先进的 AI 对话服务。凭借高效的训练策略、灵活的思维模式以及持续更新的模型家族（包括数学专用模型和奖励模型），InternLM 为开源社区提供了一个兼具性价比与技术前沿性的优质选择。","# InternLM\n\n\u003Cdiv align=\"center\">\n\n\u003Cimg src=\".\u002Fassets\u002Flogo.svg\" width=\"200\"\u002F>\n  \u003Cdiv> \u003C\u002Fdiv>\n  \u003Cdiv align=\"center\">\n    \u003Cb>\u003Cfont size=\"5\">InternLM\u003C\u002Ffont>\u003C\u002Fb>\n    \u003Csup>\n      \u003Ca href=\"https:\u002F\u002Finternlm.intern-ai.org.cn\u002F\">\n        \u003Ci>\u003Cfont size=\"4\">HOT\u003C\u002Ffont>\u003C\u002Fi>\n      \u003C\u002Fa>\n    \u003C\u002Fsup>\n    \u003Cdiv> \u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n\n[![license](.\u002Fassets\u002Flicense.svg)](.\u002FLICENSE)\n[![evaluation](.\u002Fassets\u002Fcompass_support.svg)](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F)\n\n\u003C!-- [![Documentation Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_13d664e1afd7.png)](https:\u002F\u002Finternlm.readthedocs.io\u002Fzh_CN\u002Flatest\u002F?badge=latest) -->\n\n[📘Commercial Application](#license) |\n[🤗HuggingFace](https:\u002F\u002Fhuggingface.co\u002Finternlm) |\n[🆕Update News](#news) |\n[🤔Reporting Issues](https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fissues\u002Fnew) |\n[📜Technical Report](https:\u002F\u002Farxiv.org\u002Fabs\u002F2403.17297)\u003Cbr>\n[💬Chat Web](https:\u002F\u002Finternlm-chat.intern-ai.org.cn\u002F) |\n[🔗API](https:\u002F\u002Finternlm.intern-ai.org.cn\u002Fapi\u002Fdocument) |\n[🧩Modelers](https:\u002F\u002Fmodelers.cn\u002Fspaces\u002FMindSpore-Lab\u002FINTERNLM2-20B-PLAN)\n\n[English](.\u002FREADME.md) |\n[简体中文](.\u002FREADME_zh-CN.md)\n\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n    👋 join us on \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fxa29JuW87d\" target=\"_blank\">Discord\u003C\u002Fa> and \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fassets\u002F25839884\u002Fa6aad896-7232-4220-ac84-9e070c2633ce\" target=\"_blank\">WeChat\u003C\u002Fa>\n\u003C\u002Fp>\n\n## Introduction\n\nInternLM3 has open-sourced an 8-billion parameter instruction model, InternLM3-8B-Instruct, designed for general-purpose usage and advanced reasoning. This model has the following characteristics:\n\n- **Enhanced performance at reduced cost**:\n  State-of-the-art performance on reasoning and knowledge-intensive tasks surpass models like Llama3.1-8B and Qwen2.5-7B. Remarkably, InternLM3 is trained on only 4 trillion high-quality tokens, saving more than 75% of the training cost compared to other LLMs of similar scale.\n- **Deep thinking capability**:\n  InternLM3 supports both the deep thinking mode for solving complicated reasoning tasks via the long chain-of-thought and the normal response mode for fluent user interactions.\n\n## News\n\n\\[2025.01.15\\] We release InternLM3-8B-Instruct, See [model zoo below](#model-zoo) for download or [model cards](.\u002Fmodel_cards\u002F) for more details.\n\n\\[2024.08.01\\] We release InternLM2.5-1.8B, InternLM2.5-1.8B-Chat, InternLM2.5-20B and InternLM2.5-20B-Chat. See [model zoo below](#model-zoo) for download or [model cards](.\u002Fmodel_cards\u002F) for more details.\n\n\\[2024.07.19\\] We release the InternLM2-Reward series of reward models in 1.8B, 7B and 20B sizes. See [model zoo below](#model-zoo) for download or [model cards](.\u002Fmodel_cards\u002Finternlm2_reward.md) for more details.\n\n\\[2024.07.03\\] We release InternLM2.5-7B, InternLM2.5-7B-Chat and InternLM2.5-7B-Chat-1M. See [model zoo below](#model-zoo) for download or [model cards](.\u002Fmodel_cards\u002F) for more details.\n\n\\[2024.03.26\\] We release InternLM2 technical report. See [arXiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F2403.17297) for details.\n\n\\[2024.01.31\\] We release InternLM2-1.8B, along with the associated chat model. They provide a cheaper deployment option while maintaining leading performance.\n\n\\[2024.01.23\\] We release InternLM2-Math-7B and InternLM2-Math-20B with pretraining and SFT checkpoints. They surpass ChatGPT with small sizes. See [InternLM-Math](https:\u002F\u002Fgithub.com\u002FInternLM\u002Finternlm-math) for details and download.\n\n\\[2024.01.17\\] We release InternLM2-7B and InternLM2-20B and their corresponding chat models with stronger capabilities in all dimensions. See [model zoo below](#model-zoo) for download or [model cards](.\u002Fmodel_cards\u002F) for more details.\n\n\\[2023.12.13\\] InternLM-7B-Chat and InternLM-20B-Chat checkpoints are updated. With an improved finetuning strategy, the new chat models can generate higher quality responses with greater stylistic diversity.\n\n\\[2023.09.20\\] InternLM-20B is released with base and chat versions.\n\n## Model Zoo\n\n### InternLM3\n\n| Model                     | Transformers                                             | ModelScope                                             | Modelers                                              | Release Date |\n| ------------------------- | -------------------------------------------------------- | ------------------------------------------------------ | ----------------------------------------------------- | ------------ |\n| **InternLM3-8B-Instruct** | [🤗internlm3_8B_instruct](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm3-8b-instruct) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm3_8b_instruct](https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm3-8b-instruct\u002Fsummary) | [![Open in Modelers](https:\u002F\u002Fmodelers.cn\u002Fassets\u002Flogo1-1bf58310.svg)](https:\u002F\u002Fmodelers.cn\u002Fmodels\u002FIntern\u002Finternlm3-8b-instruct) | 2025-01-15   |\n\n### InternLM2.5\n\n\u003Cdetails>\n    \u003Csummary>(click to expand)\u003C\u002Fsummary>\n\n| Model                      | Transformers(HF)                           | ModelScope(HF)                           | OpenXLab(HF)                           | OpenXLab(Origin)                           | Release Date |\n| -------------------------- | ------------------------------------------ | ---------------------------------------- | -------------------------------------- | ------------------------------------------ | ------------ |\n| **InternLM2.5-1.8B**       | [🤗internlm2_5-1_8b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-1_8b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-1_8b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-1_8b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-1_8b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-1_8b-original) | 2024-08-05   |\n| **InternLM2.5-1.8B-Chat**  | [🤗internlm2_5-1_8b-chat](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-1_8b-chat) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-1_8b-chat](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-1_8b-chat\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-1_8b-chat) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-1_8b-chat-original) | 2024-08-05   |\n| **InternLM2.5-7B**         | [🤗internlm2_5-7b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-7b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-7b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-7b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b-original) | 2024-07-03   |\n| **InternLM2.5-7B-Chat**    | [🤗internlm2_5-7b-chat](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-7b-chat) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-7b-chat](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-7b-chat\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b-chat) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b-chat-original) | 2024-07-03   |\n| **InternLM2.5-7B-Chat-1M** | [🤗internlm2_5-7b-chat-1m](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-7b-chat-1m) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-7b-chat-1m](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-7b-chat-1m\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b-chat-1m) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b-chat-1m-original) | 2024-07-03   |\n| **InternLM2.5-20B**        | [🤗internlm2_5-20b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-20b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-20b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-20b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-20b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-20b-original) | 2024-08-05   |\n| **InternLM2.5-20B-Chat**   | [🤗internlm2_5-20b-chat](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-20b-chat) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-20b-chat](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-20b-chat\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-20b-chat) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-20b-chat-original) | 2024-08-05   |\n\n**Notes:**\n\nThe release of InternLM2.5 series contains 1.8B, 7B, and 20B versions. 7B models are efficient for research and application and 20B models are more powerful and can support more complex scenarios. The relation of these models are shown as follows.\n\n1. **InternLM2.5**: Foundation models pre-trained on large-scale corpus. InternLM2.5 models are recommended for consideration in most applications.\n2. **InternLM2.5-Chat**: The Chat model that undergoes supervised fine-tuning (SFT) and reinforcement learning from human feedback (RLHF), based on the InternLM2.5 model. InternLM2.5-Chat is optimized for instruction following, chat experience, and function call, which is recommended for downstream applications.\n3. **InternLM2.5-Chat-1M**: InternLM2.5-Chat-1M supports 1M long-context with compatible performance as InternLM2.5-Chat.\n\n**Limitations:** Although we have made efforts to ensure the safety of the model during the training process and to encourage the model to generate text that complies with ethical and legal requirements, the model may still produce unexpected outputs due to its size and probabilistic generation paradigm. For example, the generated responses may contain biases, discrimination, or other harmful content. Please do not propagate such content. We are not responsible for any consequences resulting from the dissemination of harmful information.\n\n**Supplements:** `HF` refers to the format used by HuggingFace in [transformers](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftransformers), whereas `Origin` denotes the format adopted by the InternLM team in [InternEvo](https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternEvo).\n\n\u003C\u002Fdetails>\n\n### InternLM2-Reward\n\n\u003Cdetails>\n    \u003Csummary>(click to expand)\u003C\u002Fsummary>\n\nInternLM2-Reward is a series of reward models, trained on 2.4 million preference samples, available in 1.8B, 7B, and 20B sizes. These model were applied to the PPO training process of our chat models. See [model cards](.\u002Fmodel_cards\u002Finternlm2_reward.md) for more details.\n\n| Model                     | RewardBench Score | Transformers(HF)                                   | ModelScope(HF)                                    | OpenXLab(HF)                                    | Release Date |\n| ------------------------- | ----------------- | -------------------------------------------------- | ------------------------------------------------- | ----------------------------------------------- | ------------ |\n| **InternLM2-1.8B-Reward** | 80.6              | [🤗internlm2-1_8b-reward](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-1_8b-reward) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-1_8b-reward](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-1_8b-reward\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-1_8b-reward) | 2024-07-19   |\n| **InternLM2-7B-Reward**   | 86.6              | [🤗internlm2-7b-reward](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-7b-reward) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-7b-reward](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-7b-reward\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-7b-reward) | 2024-07-19   |\n| **InternLM2-20B-Reward**  | 89.5              | [🤗internlm2-20b-reward](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-20b-reward) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-20b-reward](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-20b-reward\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-20b-reward) | 2024-07-19   |\n\n\u003C\u002Fdetails>\n\n### InternLM2\n\n\u003Cdetails>\n    \u003Csummary>(click to expand)\u003C\u002Fsummary>\n\nOur previous generation models with advanced capabilities in long-context processing, reasoning, and coding. See [model cards](.\u002Fmodel_cards\u002F) for more details.\n\n| Model                       | Transformers(HF)                          | ModelScope(HF)                           | OpenXLab(HF)                           | OpenXLab(Origin)                           | Release Date |\n| --------------------------- | ----------------------------------------- | ---------------------------------------- | -------------------------------------- | ------------------------------------------ | ------------ |\n| **InternLM2-1.8B**          | [🤗internlm2-1.8b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-1_8b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-1.8b](https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-1_8b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-1.8b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-1.8b-original) | 2024-01-31   |\n| **InternLM2-Chat-1.8B-SFT** | [🤗internlm2-chat-1.8b-sft](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-1_8b-sft) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-1.8b-sft](https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-1_8b-sft\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-1.8b-sft) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-1.8b-sft-original) | 2024-01-31   |\n| **InternLM2-Chat-1.8B**     | [🤗internlm2-chat-1.8b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-1_8b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-1.8b](https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-1_8b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-1.8b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-1.8b-original) | 2024-02-19   |\n| **InternLM2-Base-7B**       | [🤗internlm2-base-7b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-base-7b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-base-7b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-base-7b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-7b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-7b-original) | 2024-01-17   |\n| **InternLM2-7B**            | [🤗internlm2-7b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-7b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-7b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-7b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-7b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-7b-original) | 2024-01-17   |\n| **InternLM2-Chat-7B-SFT**   | [🤗internlm2-chat-7b-sft](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-7b-sft) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-7b-sft](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-7b-sft\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-7b-sft) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-7b-sft-original) | 2024-01-17   |\n| **InternLM2-Chat-7B**       | [🤗internlm2-chat-7b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-7b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-7b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-7b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-7b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-7b-original) | 2024-01-17   |\n| **InternLM2-Base-20B**      | [🤗internlm2-base-20b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-base-20b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-base-20b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-base-20b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-20b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-20b-original) | 2024-01-17   |\n| **InternLM2-20B**           | [🤗internlm2-20b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-20b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-20b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-20b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-20b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-20b-original) | 2024-01-17   |\n| **InternLM2-Chat-20B-SFT**  | [🤗internlm2-chat-20b-sft](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-20b-sft) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-20b-sft](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-20b-sft\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-20b-sft) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-20b-sft-original) | 2024-01-17   |\n| **InternLM2-Chat-20B**      | [🤗internlm2-chat-20b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-20b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-20b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-20b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-20b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-20b-original) | 2024-01-17   |\n\n\u003C\u002Fdetails>\n\n## Performance\n\nWe conducted a comprehensive evaluation of InternLM using the open-source evaluation tool [OpenCompass](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F). The evaluation covered five dimensions of capabilities: disciplinary competence, language competence, knowledge competence, inference competence, and comprehension competence. Here are some of the evaluation results, and you can visit the [OpenCompass leaderboard](https:\u002F\u002Frank.opencompass.org.cn) for more evaluation results.\n\n| Benchmark    |                                 | InternLM3-8B-Instruct | Qwen2.5-7B-Instruct | Llama3.1-8B-Instruct | GPT-4o-mini(close source) |\n| ------------ | ------------------------------- | --------------------- | ------------------- | -------------------- | ------------------------- |\n| General      | CMMLU(0-shot)                   | **83.1**              | 75.8                | 53.9                 | 66.0                      |\n|              | MMLU(0-shot)                    | 76.6                  | **76.8**            | 71.8                 | 82.7                      |\n|              | MMLU-Pro(0-shot)                | **57.6**              | 56.2                | 48.1                 | 64.1                      |\n| Reasoning    | GPQA-Diamond(0-shot)            | **37.4**              | 33.3                | 24.2                 | 42.9                      |\n|              | DROP(0-shot)                    | **83.1**              | 80.4                | 81.6                 | 85.2                      |\n|              | HellaSwag(10-shot)              | **91.2**              | 85.3                | 76.7                 | 89.5                      |\n|              | KOR-Bench(0-shot)               | **56.4**              | 44.6                | 47.7                 | 58.2                      |\n| MATH         | MATH-500(0-shot)                | **83.0**\\*            | 72.4                | 48.4                 | 74.0                      |\n|              | AIME2024(0-shot)                | **20.0**\\*            | 16.7                | 6.7                  | 13.3                      |\n| Coding       | LiveCodeBench(2407-2409 Pass@1) | **17.8**              | 16.8                | 12.9                 | 21.8                      |\n|              | HumanEval(Pass@1)               | 82.3                  | **85.4**            | 72.0                 | 86.6                      |\n| Instrunction | IFEval(Prompt-Strict)           | **79.3**              | 71.7                | 75.2                 | 79.7                      |\n| Long Context | RULER(4-128K Average)           | 87.9                  | 81.4                | **88.5**             | 90.7                      |\n| Chat         | AlpacaEval 2.0(LC WinRate)      | **51.1**              | 30.3                | 25.0                 | 50.7                      |\n|              | WildBench(Raw Score)            | **33.1**              | 23.3                | 1.5                  | 40.3                      |\n|              | MT-Bench-101(Score 1-10)        | **8.59**              | 8.49                | 8.37                 | 8.87                      |\n\n- The evaluation results were obtained from [OpenCompass](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F) (some data marked with \\*, which means evaluating with Thinking Mode), and evaluation configuration can be found in the configuration files provided by [OpenCompass](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F).\n- The evaluation data may have numerical differences due to the version iteration of [OpenCompass](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F), so please refer to the latest evaluation results of [OpenCompass](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F).\n  **Limitations:** Although we have made efforts to ensure the safety of the model during the training process and to encourage the model to generate text that complies with ethical and legal requirements, the model may still produce unexpected outputs due to its size and probabilistic generation paradigm. For example, the generated responses may contain biases, discrimination, or other harmful content. Please do not propagate such content. We are not responsible for any consequences resulting from the dissemination of harmful information.\n\n### Requirements\n\n- Python >= 3.8\n- PyTorch >= 1.12.0 (2.0.0 and above are recommended)\n- Transformers >= 4.38\n\n## Usages\n\n### Conversation Mode\n\n#### Transformers inference\n\nTo load the InternLM3 8B Instruct model using Transformers, use the following code:\n\n```python\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForCausalLM\nmodel_dir = \"internlm\u002Finternlm3-8b-instruct\"\ntokenizer = AutoTokenizer.from_pretrained(model_dir, trust_remote_code=True)\n# Set `torch_dtype=torch.float16` to load model in float16, otherwise it will be loaded as float32 and might cause OOM Error.\nmodel = AutoModelForCausalLM.from_pretrained(model_dir, trust_remote_code=True, torch_dtype=torch.float16)\n# (Optional) If on low resource devices, you can load model in 4-bit or 8-bit to further save GPU memory via bitsandbytes.\n  # InternLM3 8B in 4bit will cost nearly 8GB GPU memory.\n  # pip install -U bitsandbytes\n  # 8-bit: model = AutoModelForCausalLM.from_pretrained(model_dir, device_map=\"auto\", trust_remote_code=True, load_in_8bit=True)\n  # 4-bit: model = AutoModelForCausalLM.from_pretrained(model_dir, device_map=\"auto\", trust_remote_code=True, load_in_4bit=True)\nmodel = model.eval()\nsystem_prompt = \"\"\"You are an AI assistant whose name is InternLM (书生·浦语).\n- InternLM (书生·浦语) is a conversational language model that is developed by Shanghai AI Laboratory (上海人工智能实验室). It is designed to be helpful, honest, and harmless.\n- InternLM (书生·浦语) can understand and communicate fluently in the language chosen by the user such as English and 中文.\"\"\"\nmessages = [\n    {\"role\": \"system\", \"content\": system_prompt},\n    {\"role\": \"user\", \"content\": \"Please tell me five scenic spots in Shanghai\"},\n ]\ntokenized_chat = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors=\"pt\")\ngenerated_ids = model.generate(tokenized_chat, max_new_tokens=1024, temperature=1, repetition_penalty=1.005, top_k=40, top_p=0.8)\ngenerated_ids = [\n    output_ids[len(input_ids):] for input_ids, output_ids in zip(tokenized_chat, generated_ids)\n]\nprompt = tokenizer.batch_decode(tokenized_chat)[0]\nprint(prompt)\nresponse = tokenizer.batch_decode(generated_ids)[0]\nprint(response)\n```\n\n#### LMDeploy inference\n\nLMDeploy is a toolkit for compressing, deploying, and serving LLM, developed by the MMRazor and MMDeploy teams.\n\n```bash\npip install lmdeploy\n```\n\nYou can run batch inference locally with the following python code:\n\n```python\nimport lmdeploy\nmodel_dir = \"internlm\u002Finternlm3-8b-instruct\"\npipe = lmdeploy.pipeline(model_dir)\nresponse = pipe(\"Please tell me five scenic spots in Shanghai\")\nprint(response)\n```\n\nOr you can launch an OpenAI compatible server with the following command:\n\n```bash\nlmdeploy serve api_server internlm\u002Finternlm3-8b-instruct --model-name internlm3-8b-instruct --server-port 23333\n```\n\nThen you can send a chat request to the server:\n\n```bash\ncurl http:\u002F\u002Flocalhost:23333\u002Fv1\u002Fchat\u002Fcompletions \\\n    -H \"Content-Type: application\u002Fjson\" \\\n    -d '{\n    \"model\": \"internlm3-8b-instruct\",\n    \"messages\": [\n    {\"role\": \"user\", \"content\": \"Please tell me five scenic spots in Shanghai\"}\n    ]\n    }'\n```\n\nFind more details in the [LMDeploy documentation](https:\u002F\u002Flmdeploy.readthedocs.io\u002Fen\u002Flatest\u002F)\n\n#### SGLang inference\n\n##### Installation\n\n```bash\npip3 install \"sglang[srt]>=0.4.1.post6\" --find-links https:\u002F\u002Fflashinfer.ai\u002Fwhl\u002Fcu124\u002Ftorch2.4\u002Fflashinfer\u002F\n```\n\n##### OpenAI Compatible Server\n\n```bash\npython3 -m sglang.launch_server --model internlm\u002Finternlm3-8b-instruct --trust-remote-code --chat-template internlm2-chat\n```\n\n##### OpenAI client\n\n```python3\nimport openai\nclient = openai.Client(\n    base_url=\"http:\u002F\u002F127.0.0.1:30000\u002Fv1\", api_key=\"EMPTY\")\n\n# Chat completion\nresponse = client.chat.completions.create(\n    model=\"default\",\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a helpful AI assistant\"},\n        {\"role\": \"user\", \"content\": \"List 3 countries and their capitals.\"},\n    ],\n    temperature=0,\n    max_tokens=64,\n)\nprint(response)\n```\n\n#### Ollama inference\n\ninstall ollama and pull the model\n\n```bash\n# install ollama\ncurl -fsSL https:\u002F\u002Follama.com\u002Finstall.sh | sh\n# pull the model\nollama pull internlm\u002Finternlm3-8b-instruct\n# install ollama-python\npip install ollama\n```\n\ninference code:\n\n```python\nimport ollama\n\nsystem_prompt = \"\"\"You are an AI assistant whose name is InternLM (书生·浦语).\n- InternLM (书生·浦语) is a conversational language model that is developed by Shanghai AI Laboratory (上海人工智能实验室). It is designed to be helpful, honest, and harmless.\n- InternLM (书生·浦语) can understand and communicate fluently in the language chosen by the user such as English and 中文.\"\"\"\n\nmessages = [\n    {\n        \"role\": \"system\",\n        \"content\": system_prompt,\n    },\n    {\n        \"role\": \"user\",\n        \"content\": \"Please tell me five scenic spots in Shanghai\"\n    },\n]\n\nstream = ollama.chat(\n    model='internlm\u002Finternlm3-8b-instruct',\n    messages=messages,\n    stream=True,\n)\n\nfor chunk in stream:\n  print(chunk['message']['content'], end='', flush=True)\n```\n\n#### vLLM inference\n\nrefer to [installation](https:\u002F\u002Fdocs.vllm.ai\u002Fen\u002Flatest\u002Fgetting_started\u002Finstallation\u002Findex.html) to install the latest code of vllm\n\n```python\npip install vllm --pre --extra-index-url https:\u002F\u002Fwheels.vllm.ai\u002Fnightly\n```\n\ninference code:\n\n```python\nfrom vllm import LLM, SamplingParams\nllm = LLM(model=\"internlm\u002Finternlm3-8b-instruct\")\nsampling_params = SamplingParams(temperature=1, repetition_penalty=1.005, top_k=40, top_p=0.8)\nsystem_prompt = \"\"\"You are an AI assistant whose name is InternLM (书生·浦语).\n- InternLM (书生·浦语) is a conversational language model that is developed by Shanghai AI Laboratory (上海人工智能实验室). It is designed to be helpful, honest, and harmless.\n- InternLM (书生·浦语) can understand and communicate fluently in the language chosen by the user such as English and 中文.\"\"\"\nprompts = [\n    {\n        \"role\": \"system\",\n        \"content\": system_prompt,\n    },\n    {\n        \"role\": \"user\",\n        \"content\": \"Please tell me five scenic spots in Shanghai\"\n    },\n]\noutputs = llm.chat(prompts,\n                   sampling_params=sampling_params,\n                   use_tqdm=False)\nprint(outputs)\n```\n\n### Thinking Mode\n\n#### Thinking Demo\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_1f2ca08cdd66.png\" width=\"400\"\u002F>\n\n#### Thinking system prompt\n\n```python\nthinking_system_prompt = \"\"\"You are an expert mathematician with extensive experience in mathematical competitions. You approach problems through systematic thinking and rigorous reasoning. When solving problems, follow these thought processes:\n## Deep Understanding\nTake time to fully comprehend the problem before attempting a solution. Consider:\n- What is the real question being asked?\n- What are the given conditions and what do they tell us?\n- Are there any special restrictions or assumptions?\n- Which information is crucial and which is supplementary?\n## Multi-angle Analysis\nBefore solving, conduct thorough analysis:\n- What mathematical concepts and properties are involved?\n- Can you recall similar classic problems or solution methods?\n- Would diagrams or tables help visualize the problem?\n- Are there special cases that need separate consideration?\n## Systematic Thinking\nPlan your solution path:\n- Propose multiple possible approaches\n- Analyze the feasibility and merits of each method\n- Choose the most appropriate method and explain why\n- Break complex problems into smaller, manageable steps\n## Rigorous Proof\nDuring the solution process:\n- Provide solid justification for each step\n- Include detailed proofs for key conclusions\n- Pay attention to logical connections\n- Be vigilant about potential oversights\n## Repeated Verification\nAfter completing your solution:\n- Verify your results satisfy all conditions\n- Check for overlooked special cases\n- Consider if the solution can be optimized or simplified\n- Review your reasoning process\nRemember:\n1. Take time to think thoroughly rather than rushing to an answer\n2. Rigorously prove each key conclusion\n3. Keep an open mind and try different approaches\n4. Summarize valuable problem-solving methods\n5. Maintain healthy skepticism and verify multiple times\nYour response should reflect deep mathematical understanding and precise logical thinking, making your solution path and reasoning clear to others.\nWhen you're ready, present your complete solution with:\n- Clear problem understanding\n- Detailed solution process\n- Key insights\n- Thorough verification\nFocus on clear, logical progression of ideas and thorough explanation of your mathematical reasoning. Provide answers in the same language as the user asking the question, repeat the final answer using a '\\\\boxed{}' without any units, you have [[8192]] tokens to complete the answer.\n\"\"\"\n```\n\n#### Transformers inference\n\n```python\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForCausalLM\nmodel_dir = \"internlm\u002Finternlm3-8b-instruct\"\ntokenizer = AutoTokenizer.from_pretrained(model_dir, trust_remote_code=True)\n# Set `torch_dtype=torch.float16` to load model in float16, otherwise it will be loaded as float32 and might cause OOM Error.\nmodel = AutoModelForCausalLM.from_pretrained(model_dir, trust_remote_code=True, torch_dtype=torch.float16)\n# (Optional) If on low resource devices, you can load model in 4-bit or 8-bit to further save GPU memory via bitsandbytes.\n  # InternLM3 8B in 4bit will cost nearly 8GB GPU memory.\n  # pip install -U bitsandbytes\n  # 8-bit: model = AutoModelForCausalLM.from_pretrained(model_dir, device_map=\"auto\", trust_remote_code=True, load_in_8bit=True)\n  # 4-bit: model = AutoModelForCausalLM.from_pretrained(model_dir, device_map=\"auto\", trust_remote_code=True, load_in_4bit=True)\nmodel = model.eval()\nmessages = [\n    {\"role\": \"system\", \"content\": thinking_system_prompt},\n    {\"role\": \"user\", \"content\": \"Given the function\\(f(x)=\\mathrm{e}^{x}-ax - a^{3}\\),\\n(1) When \\(a = 1\\), find the equation of the tangent line to the curve \\(y = f(x)\\) at the point \\((1,f(1))\\).\\n(2) If \\(f(x)\\) has a local minimum and the minimum value is less than \\(0\\), determine the range of values for \\(a\\).\"},\n ]\ntokenized_chat = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors=\"pt\")\ngenerated_ids = model.generate(tokenized_chat, max_new_tokens=8192)\ngenerated_ids = [\n    output_ids[len(input_ids):] for input_ids, output_ids in zip(tokenized_chat, generated_ids)\n]\nprompt = tokenizer.batch_decode(tokenized_chat)[0]\nprint(prompt)\nresponse = tokenizer.batch_decode(generated_ids)[0]\nprint(response)\n```\n\n#### LMDeploy inference\n\nLMDeploy is a toolkit for compressing, deploying, and serving LLM.\n\n```bash\npip install lmdeploy\n```\n\nYou can run batch inference locally with the following python code:\n\n```python\nfrom lmdeploy import pipeline, GenerationConfig, ChatTemplateConfig\nmodel_dir = \"internlm\u002Finternlm3-8b-instruct\"\nchat_template_config = ChatTemplateConfig(model_name='internlm3')\npipe = pipeline(model_dir, chat_template_config=chat_template_config)\nmessages = [\n        {\"role\": \"system\", \"content\": thinking_system_prompt},\n        {\"role\": \"user\", \"content\": \"Given the function\\(f(x)=\\mathrm{e}^{x}-ax - a^{3}\\),\\n(1) When \\(a = 1\\), find the equation of the tangent line to the curve \\(y = f(x)\\) at the point \\((1,f(1))\\).\\n(2) If \\(f(x)\\) has a local minimum and the minimum value is less than \\(0\\), determine the range of values for \\(a\\).\"},\n]\nresponse = pipe(messages, gen_config=GenerationConfig(max_new_tokens=2048))\nprint(response)\n```\n\n#### SGLang inference\n\nInstallation\n\n```bash\npip3 install \"sglang[srt]>=0.4.1.post6\" --find-links https:\u002F\u002Fflashinfer.ai\u002Fwhl\u002Fcu124\u002Ftorch2.4\u002Fflashinfer\u002F\n```\n\nFor offline engine api usage, please refer to [Offline Engine API](https:\u002F\u002Fdocs.sglang.ai\u002Fbackend\u002Foffline_engine_api.html)\n\n#### Ollama inference\n\ninstall ollama and pull the model\n\n```bash\n# install ollama\ncurl -fsSL https:\u002F\u002Follama.com\u002Finstall.sh | sh\n# pull the model\nollama pull internlm\u002Finternlm3-8b-instruct\n# install ollama-python\npip install ollama\n```\n\ninference code:\n\n```python\nimport ollama\n\nmessages = [\n    {\n        \"role\": \"system\",\n        \"content\": thinking_system_prompt,\n    },\n    {\n        \"role\": \"user\",\n        \"content\": \"已知函数\\(f(x)=\\mathrm{e}^{x}-ax - a^{3}\\)。\\n（1）当\\(a = 1\\)时，求曲线\\(y = f(x)\\)在点\\((1,f(1))\\)处的切线方程；\\n（2）若\\(f(x)\\)有极小值，且极小值小于\\(0\\)，求\\(a\\)的取值范围。\"\n    },\n]\n\nstream = ollama.chat(\n    model='internlm\u002Finternlm3-8b-instruct',\n    messages=messages,\n    stream=True,\n    options=dict(num_ctx=8192, num_predict=2048)\n)\n\nfor chunk in stream:\n  print(chunk['message']['content'], end='', flush=True)\n```\n\n#### vLLM inference\n\nrefer to [installation](https:\u002F\u002Fdocs.vllm.ai\u002Fen\u002Flatest\u002Fgetting_started\u002Finstallation\u002Findex.html) to install the latest code of vllm\n\n```python\npip install vllm --pre --extra-index-url https:\u002F\u002Fwheels.vllm.ai\u002Fnightly\n```\n\ninference code\n\n```python\nfrom vllm import LLM, SamplingParams\nllm = LLM(model=\"internlm\u002Finternlm3-8b-instruct\")\nsampling_params = SamplingParams(temperature=1, repetition_penalty=1.005, top_k=40, top_p=0.8, max_tokens=8192)\nprompts = [\n    {\n        \"role\": \"system\",\n        \"content\": thinking_system_prompt,\n    },\n    {\n        \"role\": \"user\",\n        \"content\": \"Given the function\\(f(x)=\\mathrm{e}^{x}-ax - a^{3}\\),\\n(1) When \\(a = 1\\), find the equation of the tangent line to the curve \\(y = f(x)\\) at the point \\((1,f(1))\\).\\n(2) If \\(f(x)\\) has a local minimum and the minimum value is less than \\(0\\), determine the range of values for \\(a\\).\"\n    },\n]\noutputs = llm.chat(prompts,\n                   sampling_params=sampling_params,\n                   use_tqdm=False)\nprint(outputs)\n```\n\n## License\n\nCode and model weights are licensed under Apache-2.0.\n\n## Citation\n\n```\n@misc{cai2024internlm2,\n      title={InternLM2 Technical Report},\n      author={Zheng Cai and Maosong Cao and Haojiong Chen and Kai Chen and Keyu Chen and Xin Chen and Xun Chen and Zehui Chen and Zhi Chen and Pei Chu and Xiaoyi Dong and Haodong Duan and Qi Fan and Zhaoye Fei and Yang Gao and Jiaye Ge and Chenya Gu and Yuzhe Gu and Tao Gui and Aijia Guo and Qipeng Guo and Conghui He and Yingfan Hu and Ting Huang and Tao Jiang and Penglong Jiao and Zhenjiang Jin and Zhikai Lei and Jiaxing Li and Jingwen Li and Linyang Li and Shuaibin Li and Wei Li and Yining Li and Hongwei Liu and Jiangning Liu and Jiawei Hong and Kaiwen Liu and Kuikun Liu and Xiaoran Liu and Chengqi Lv and Haijun Lv and Kai Lv and Li Ma and Runyuan Ma and Zerun Ma and Wenchang Ning and Linke Ouyang and Jiantao Qiu and Yuan Qu and Fukai Shang and Yunfan Shao and Demin Song and Zifan Song and Zhihao Sui and Peng Sun and Yu Sun and Huanze Tang and Bin Wang and Guoteng Wang and Jiaqi Wang and Jiayu Wang and Rui Wang and Yudong Wang and Ziyi Wang and Xingjian Wei and Qizhen Weng and Fan Wu and Yingtong Xiong and Chao Xu and Ruiliang Xu and Hang Yan and Yirong Yan and Xiaogui Yang and Haochen Ye and Huaiyuan Ying and Jia Yu and Jing Yu and Yuhang Zang and Chuyu Zhang and Li Zhang and Pan Zhang and Peng Zhang and Ruijie Zhang and Shuo Zhang and Songyang Zhang and Wenjian Zhang and Wenwei Zhang and Xingcheng Zhang and Xinyue Zhang and Hui Zhao and Qian Zhao and Xiaomeng Zhao and Fengzhe Zhou and Zaida Zhou and Jingming Zhuo and Yicheng Zou and Xipeng Qiu and Yu Qiao and Dahua Lin},\n      year={2024},\n      eprint={2403.17297},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL}\n}\n```\n","# InternLM\n\n\u003Cdiv align=\"center\">\n\n\u003Cimg src=\".\u002Fassets\u002Flogo.svg\" width=\"200\"\u002F>\n  \u003Cdiv> \u003C\u002Fdiv>\n  \u003Cdiv align=\"center\">\n    \u003Cb>\u003Cfont size=\"5\">InternLM\u003C\u002Ffont>\u003C\u002Fb>\n    \u003Csup>\n      \u003Ca href=\"https:\u002F\u002Finternlm.intern-ai.org.cn\u002F\">\n        \u003Ci>\u003Cfont size=\"4\">热门\u003C\u002Ffont>\u003C\u002Fi>\n      \u003C\u002Fa>\n    \u003C\u002Fsup>\n    \u003Cdiv> \u003C\u002Fdiv>\n  \u003C\u002Fdiv>\n\n[![license](.\u002Fassets\u002Flicense.svg)](.\u002FLICENSE)\n[![evaluation](.\u002Fassets\u002Fcompass_support.svg)](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F)\n\n\u003C!-- [![Documentation Status](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_13d664e1afd7.png)](https:\u002F\u002Finternlm.readthedocs.io\u002Fzh_CN\u002Flatest\u002F?badge=latest) -->\n\n[📘商业应用](#license) |\n[🤗HuggingFace](https:\u002F\u002Fhuggingface.co\u002Finternlm) |\n[🆕更新消息](#news) |\n[🤔问题反馈](https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fissues\u002Fnew) |\n[📜技术报告](https:\u002F\u002Farxiv.org\u002Fabs\u002F2403.17297)\u003Cbr>\n[💬聊天网页](https:\u002F\u002Finternlm-chat.intern-ai.org.cn\u002F) |\n[🔗API](https:\u002F\u002Finternlm.intern-ai.org.cn\u002Fapi\u002Fdocument) |\n[🧩Modelers](https:\u002F\u002Fmodelers.cn\u002Fspaces\u002FMindSpore-Lab\u002FINTERNLM2-20B-PLAN)\n\n[English](.\u002FREADME.md) |\n[简体中文](.\u002FREADME_zh-CN.md)\n\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n    👋 欢迎加入我们的 \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fxa29JuW87d\" target=\"_blank\">Discord\u003C\u002Fa> 和 \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fassets\u002F25839884\u002Fa6aad896-7232-4220-ac84-9e070c2633ce\" target=\"_blank\">微信\u003C\u002Fa>\n\u003C\u002Fp>\n\n## 简介\n\nInternLM3 开源了一款 80 亿参数的指令模型 InternLM3-8B-Instruct，专为通用场景和高级推理设计。该模型具有以下特点：\n\n- **性能提升，成本降低**：在推理和知识密集型任务上达到业界领先水平，超越 Llama3.1-8B 和 Qwen2.5-7B 等模型。令人瞩目的是，InternLM3 仅使用了 4 万亿高质量 tokens 进行训练，相比同类规模的大模型节省了超过 75% 的训练成本。\n- **深度思考能力**：InternLM3 同时支持通过长链式思维解决复杂推理任务的深度思考模式，以及用于流畅用户交互的普通响应模式。\n\n## 新闻\n\n\\[2025.01.15\\] 我们发布了 InternLM3-8B-Instruct，请参阅下方的 [模型库](#model-zoo) 获取下载链接，或访问 [模型卡片](.\u002Fmodel_cards\u002F) 了解更多详情。\n\n\\[2024.08.01\\] 我们发布了 InternLM2.5-1.8B、InternLM2.5-1.8B-Chat、InternLM2.5-20B 和 InternLM2.5-20B-Chat。请参阅下方的 [模型库](#model-zoo) 获取下载链接，或访问 [模型卡片](.\u002Fmodel_cards\u002F) 了解更多详情。\n\n\\[2024.07.19\\] 我们发布了 InternLM2-Reward 系列奖励模型，包括 1.8B、7B 和 20B 三种规模。请参阅下方的 [模型库](#model-zoo) 获取下载链接，或访问 [模型卡片](.\u002Fmodel_cards\u002Finternlm2_reward.md) 了解更多详情。\n\n\\[2024.07.03\\] 我们发布了 InternLM2.5-7B、InternLM2.5-7B-Chat 和 InternLM2.5-7B-Chat-1M。请参阅下方的 [模型库](#model-zoo) 获取下载链接，或访问 [模型卡片](.\u002Fmodel_cards\u002F) 了解更多详情。\n\n\\[2024.03.26\\] 我们发布了 InternLM2 技术报告。详情请参阅 [arXiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F2403.17297)。\n\n\\[2024.01.31\\] 我们发布了 InternLM2-1.8B 及其对应的聊天模型。它们在保持领先性能的同时，提供了更为经济的部署方案。\n\n\\[2024.01.23\\] 我们发布了 InternLM2-Math-7B 和 InternLM2-Math-20B，包含预训练和 SFT 检查点。这些模型以较小的规模便超越了 ChatGPT。详情及下载请参阅 [InternLM-Math](https:\u002F\u002Fgithub.com\u002FInternLM\u002Finternlm-math)。\n\n\\[2024.01.17\\] 我们发布了 InternLM2-7B 和 InternLM2-20B，以及它们对应的聊天模型，各方面能力均得到显著提升。请参阅下方的 [模型库](#model-zoo) 获取下载链接，或访问 [模型卡片](.\u002Fmodel_cards\u002F) 了解更多详情。\n\n\\[2023.12.13\\] InternLM-7B-Chat 和 InternLM-20B-Chat 的检查点已更新。通过改进的微调策略，新的聊天模型能够生成更高质量、风格更加多样的回复。\n\n\\[2023.09.20\\] InternLM-20B 正式发布，包含基础版和聊天版。\n\n## 模型库\n\n### InternLM3\n\n| 模型                     | Transformers                                             | ModelScope                                             | Modelers                                              | 发布日期 |\n| ------------------------- | -------------------------------------------------------- | ------------------------------------------------------ | ----------------------------------------------------- | ---------- |\n| **InternLM3-8B-Instruct** | [🤗internlm3_8B_instruct](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm3-8b-instruct) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm3_8b_instruct](https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm3-8b-instruct\u002Fsummary) | [![在 Modelers 中打开](https:\u002F\u002Fmodelers.cn\u002Fassets\u002Flogo1-1bf58310.svg)](https:\u002F\u002Fmodelers.cn\u002Fmodels\u002FIntern\u002Finternlm3-8b-instruct) | 2025-01-15   |\n\n### InternLM2.5\n\n\u003Cdetails>\n    \u003Csummary>(点击展开)\u003C\u002Fsummary>\n\n| 模型                      | Transformers(HF)                           | ModelScope(HF)                           | OpenXLab(HF)                           | OpenXLab(Origin)                           | 发布日期 |\n| -------------------------- | ------------------------------------------ | ---------------------------------------- | -------------------------------------- | ------------------------------------------ | ---------- |\n| **InternLM2.5-1.8B**       | [🤗internlm2_5-1_8b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-1_8b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-1_8b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-1_8b\u002Fsummary) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-1_8b) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-1_8b-original) | 2024-08-05   |\n| **InternLM2.5-1.8B-Chat**  | [🤗internlm2_5-1_8b-chat](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-1_8b-chat) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-1_8b-chat](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-1_8b-chat\u002Fsummary) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-1_8b-chat) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-1_8b-chat-original) | 2024-08-05   |\n| **InternLM2.5-7B**         | [🤗internlm2_5-7b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-7b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-7b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-7b\u002Fsummary) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b-original) | 2024-07-03   |\n| **InternLM2.5-7B-Chat**    | [🤗internlm2_5-7b-chat](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-7b-chat) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-7b-chat](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-7b-chat\u002Fsummary) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b-chat) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b-chat-original) | 2024-07-03   |\n| **InternLM2.5-7B-Chat-1M** | [🤗internlm2_5-7b-chat-1m](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-7b-chat-1m) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-7b-chat-1m](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-7b-chat-1m\u002Fsummary) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b-chat-1m) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-7b-chat-1m-original) | 2024-07-03   |\n| **InternLM2.5-20B**        | [🤗internlm2_5-20b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-20b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-20b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-20b\u002Fsummary) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-20b) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-20b-original) | 2024-08-05   |\n| **InternLM2.5-20B-Chat**   | [🤗internlm2_5-20b-chat](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2_5-20b-chat) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2_5-20b-chat](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2_5-20b-chat\u002Fsummary) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-20b-chat) | [![在OpenXLab中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2_5-20b-chat-original) | 2024-08-05   |\n\n**说明：**\n\nInternLM2.5系列包括1.8B、7B和20B三个版本。7B模型在研究和应用中较为高效，而20B模型功能更强大，能够支持更复杂的场景。这些模型之间的关系如下：\n\n1. **InternLM2.5**：基于大规模语料预训练的基础模型。在大多数应用场景中，建议优先考虑使用InternLM2.5模型。\n2. **InternLM2.5-Chat**：在InternLM2.5基础上，经过监督微调（SFT）和人类反馈强化学习（RLHF）优化的对话模型。InternLM2.5-Chat针对指令遵循、对话体验和函数调用进行了优化，推荐用于下游应用。\n3. **InternLM2.5-Chat-1M**：该模型支持100万 token的长上下文，同时保持与InternLM2.5-Chat相当的性能。\n\n**局限性：** 尽管我们在训练过程中尽力确保模型的安全性，并鼓励其生成符合伦理和法律要求的文本，但由于模型规模较大且采用概率生成机制，仍可能出现意外输出。例如，生成的回答可能包含偏见、歧视或其他有害内容。请勿传播此类内容。对于因传播有害信息而产生的任何后果，我们概不负责。\n\n**补充说明：** `HF` 指的是 HuggingFace 在 [transformers](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftransformers) 中使用的格式，而 `Origin` 则表示 InternLM 团队在 [InternEvo](https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternEvo) 中采用的格式。\n\n\u003C\u002Fdetails>\n\n### InternLM2-Reward\n\n\u003Cdetails>\n    \u003Csummary>(点击展开)\u003C\u002Fsummary>\n\nInternLM2-Reward 是一系列奖励模型，基于 240 万条偏好样本进行训练，提供 18 亿、70 亿和 200 亿三种参数规模。这些模型被应用于我们对话模型的 PPO 训练过程中。更多详情请参阅 [模型卡片](.\u002Fmodel_cards\u002Finternlm2_reward.md)。\n\n| 模型                     | RewardBench 分数 | Transformers(HF)                                   | ModelScope(HF)                                    | OpenXLab(HF)                                    | 发布日期 |\n| ------------------------- | ----------------- | -------------------------------------------------- | ------------------------------------------------- | ----------------------------------------------- | ------------ |\n| **InternLM2-1.8B-Reward** | 80.6              | [🤗internlm2-1_8b-reward](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-1_8b-reward) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-1_8b-reward](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-1_8b-reward\u002Fsummary) | [![在 OpenXLab 中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-1_8b-reward) | 2024-07-19   |\n| **InternLM2-7B-Reward**   | 86.6              | [🤗internlm2-7b-reward](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-7b-reward) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-7b-reward](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-7b-reward\u002Fsummary) | [![在 OpenXLab 中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-7b-reward) | 2024-07-19   |\n| **InternLM2-20B-Reward**  | 89.5              | [🤗internlm2-20b-reward](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-20b-reward) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-20b-reward](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-20b-reward\u002Fsummary) | [![在 OpenXLab 中打开](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-20b-reward) | 2024-07-19   |\n\n\u003C\u002Fdetails>\n\n### InternLM2\n\n\u003Cdetails>\n    \u003Csummary>(点击展开)\u003C\u002Fsummary>\n\n我们上一代模型，在长上下文处理、推理和编程方面具有先进能力。更多详情请参阅 [模型卡片](.\u002Fmodel_cards\u002F)。\n\n| 模型                       | Transformers(HF)                          | ModelScope(HF)                           | OpenXLab(HF)                           | OpenXLab(Origin)                           | 发布日期 |\n| --------------------------- | ----------------------------------------- | ---------------------------------------- | -------------------------------------- | ------------------------------------------ | ------------ |\n| **InternLM2-1.8B**          | [🤗internlm2-1.8b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-1_8b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-1.8b](https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-1_8b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-1.8b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-1.8b-original) | 2024-01-31   |\n| **InternLM2-Chat-1.8B-SFT** | [🤗internlm2-chat-1.8b-sft](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-1_8b-sft) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-1.8b-sft](https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-1_8b-sft\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-1.8b-sft) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-1.8b-sft-original) | 2024-01-31   |\n| **InternLM2-Chat-1.8B**     | [🤗internlm2-chat-1.8b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-1_8b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-1.8b](https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-1_8b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-1.8b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-1.8b-original) | 2024-02-19   |\n| **InternLM2-Base-7B**       | [🤗internlm2-base-7b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-base-7b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-base-7b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-base-7b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-7b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-7b-original) | 2024-01-17   |\n| **InternLM2-7B**            | [🤗internlm2-7b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-7b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-7b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-7b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-7b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-7b-original) | 2024-01-17   |\n| **InternLM2-Chat-7B-SFT**   | [🤗internlm2-chat-7b-sft](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-7b-sft) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-7b-sft](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-7b-sft\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-7b-sft) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-7b-sft-original) | 2024-01-17   |\n| **InternLM2-Chat-7B**       | [🤗internlm2-chat-7b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-7b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-7b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-7b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-7b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-7b-original) | 2024-01-17   |\n| **InternLM2-Base-20B**      | [🤗internlm2-base-20b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-base-20b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-base-20b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-base-20b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-20b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-base-20b-original) | 2024-01-17   |\n| **InternLM2-20B**           | [🤗internlm2-20b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-20b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-20b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-20b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-20b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-20b-original) | 2024-01-17   |\n| **InternLM2-Chat-20B-SFT**  | [🤗internlm2-chat-20b-sft](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-20b-sft) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-20b-sft](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-20b-sft\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-20b-sft) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-20b-sft-original) | 2024-01-17   |\n| **InternLM2-Chat-20B**      | [🤗internlm2-chat-20b](https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm2-chat-20b) | [\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_375e99f5914e.png\" width=\"20px\" \u002F> internlm2-chat-20b](https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm2-chat-20b\u002Fsummary) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-20b) | [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fheader\u002Fopenxlab_models.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fmodels\u002Fdetail\u002FOpenLMLab\u002Finternlm2-chat-20b-original) | 2024-01-17   |\n\n\u003C\u002Fdetails>\n\n\n\n## 性能\n\n我们使用开源评估工具 [OpenCompass](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F) 对 InternLM 进行了全面的评估。评估涵盖了五个能力维度：学科能力、语言能力、知识能力、推理能力和理解能力。以下是一些评估结果，更多评估结果请访问 [OpenCompass 排行榜](https:\u002F\u002Frank.opencompass.org.cn)。\n\n| 基准测试    |                                 | InternLM3-8B-Instruct | Qwen2.5-7B-Instruct | Llama3.1-8B-Instruct | GPT-4o-mini(闭源) |\n| ------------ | ------------------------------- | --------------------- | ------------------- | -------------------- | ------------------------- |\n| 通用        | CMMLU(零样本)                   | **83.1**              | 75.8                | 53.9                 | 66.0                      |\n|              | MMLU(零样本)                    | 76.6                  | **76.8**            | 71.8                 | 82.7                      |\n|              | MMLU-Pro(零样本)                | **57.6**              | 56.2                | 48.1                 | 64.1                      |\n| 推理        | GPQA-Diamond(零样本)            | **37.4**              | 33.3                | 24.2                 | 42.9                      |\n|              | DROP(零样本)                    | **83.1**              | 80.4                | 81.6                 | 85.2                      |\n|              | HellaSwag(10样本)               | **91.2**              | 85.3                | 76.7                 | 89.5                      |\n|              | KOR-Bench(零样本)               | **56.4**              | 44.6                | 47.7                 | 58.2                      |\n| 数学        | MATH-500(零样本)                | **83.0**\\*            | 72.4                | 48.4                 | 74.0                      |\n|              | AIME2024(零样本)                | **20.0**\\*            | 16.7                | 6.7                  | 13.3                      |\n| 编程        | LiveCodeBench(2407-2409 Pass@1) | **17.8**              | 16.8                | 12.9                 | 21.8                      |\n|              | HumanEval(Pass@1)               | 82.3                  | **85.4**            | 72.0                 | 86.6                      |\n| 指令        | IFEval(Prompt-Strict)           | **79.3**              | 71.7                | 75.2                 | 79.7                      |\n| 长上下文    | RULER(4-128K 平均)             | 87.9                  | 81.4                | **88.5**             | 90.7                      |\n| 聊天        | AlpacaEval 2.0(LC 胜率)         | **51.1**              | 30.3                | 25.0                 | 50.7                      |\n|              | WildBench(原始分数)             | **33.1**              | 23.3                | 1.5                  | 40.3                      |\n|              | MT-Bench-101(1-10分)            | **8.59**              | 8.49                | 8.37                 | 8.87                      |\n\n- 评估结果来自 [OpenCompass](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F)（部分数据标有 \\*，表示以思考模式进行评估），评估配置可在 [OpenCompass](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F) 提供的配置文件中找到。\n- 由于 [OpenCompass](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F) 的版本迭代，评估数据可能存在数值差异，请以 [OpenCompass](https:\u002F\u002Fgithub.com\u002FinternLM\u002FOpenCompass\u002F) 的最新评估结果为准。\n  **局限性：** 尽管我们在训练过程中努力确保模型的安全性，并鼓励模型生成符合伦理和法律要求的文本，但由于模型规模较大且采用概率生成机制，仍可能出现意外输出。例如，生成的回答可能包含偏见、歧视或其他有害内容。请勿传播此类内容。对于因传播有害信息而产生的任何后果，我们概不负责。\n\n### 环境要求\n\n- Python >= 3.8\n- PyTorch >= 1.12.0（建议使用 2.0.0 及以上版本）\n- Transformers >= 4.38\n\n## 使用方法\n\n### 对话模式\n\n#### Transformers 推理\n\n要使用 Transformers 加载 InternLM3 8B Instruct 模型，可以使用以下代码：\n\n```python\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForCausalLM\nmodel_dir = \"internlm\u002Finternlm3-8b-instruct\"\ntokenizer = AutoTokenizer.from_pretrained(model_dir, trust_remote_code=True)\n# 设置 `torch_dtype=torch.float16` 以加载半精度浮点数模型，否则将加载为单精度浮点数，可能导致内存溢出错误。\nmodel = AutoModelForCausalLM.from_pretrained(model_dir，trust_remote_code=True, torch_dtype=torch.float16)\n\n# （可选）如果在资源有限的设备上运行，可以通过 bitsandbytes 以 4 位或 8 位精度加载模型，从而进一步节省显存。\n  # InternLM3 8B 模型使用 4 位精度时，大约需要 8GB 显存。\n  # pip install -U bitsandbytes\n  # 8 位精度：model = AutoModelForCausalLM.from_pretrained(model_dir, device_map=\"auto\", trust_remote_code=True, load_in_8bit=True)\n  # 4 位精度：model = AutoModelForCausalLM.from_pretrained(model_dir, device_map=\"auto\", trust_remote_code=True, load_in_4bit=True)\nmodel = model.eval()\nsystem_prompt = \"\"\"你是一个名为 InternLM（书生·浦语）的AI助手。\n- InternLM（书生·浦语）是由上海人工智能实验室开发的对话式语言模型。它旨在做到有用、诚实和无害。\n- InternLM（书生·浦语）能够理解并流利地使用用户选择的语言进行交流，例如英语和中文。\"\"\"\nmessages = [\n    {\"role\": \"system\", \"content\": system_prompt},\n    {\"role\": \"user\", \"content\": \"请告诉我上海的五个景点\"},\n ]\ntokenized_chat = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors=\"pt\")\ngenerated_ids = model.generate(tokenized_chat, max_new_tokens=1024, temperature=1, repetition_penalty=1.005, top_k=40, top_p=0.8)\ngenerated_ids = [\n    output_ids[len(input_ids):] for input_ids, output_ids in zip(tokenized_chat, generated_ids)\n]\nprompt = tokenizer.batch_decode(tokenized_chat)[0]\nprint(prompt)\nresponse = tokenizer.batch_decode(generated_ids)[0]\nprint(response)\n```\n\n#### LMDeploy 推理\n\nLMDeploy 是由 MMRazor 和 MMDeploy 团队开发的用于压缩、部署和推理 LLM 的工具包。\n\n```bash\npip install lmdeploy\n```\n\n你可以使用以下 Python 代码在本地运行批量推理：\n\n```python\nimport lmdeploy\nmodel_dir = \"internlm\u002Finternlm3-8b-instruct\"\npipe = lmdeploy.pipeline(model_dir)\nresponse = pipe(\"请告诉我上海的五个景点\")\nprint(response)\n```\n\n或者，你可以通过以下命令启动一个兼容 OpenAI 的服务器：\n\n```bash\nlmdeploy serve api_server internlm\u002Finternlm3-8b-instruct --model-name internlm3-8b-instruct --server-port 23333\n```\n\n然后你可以向该服务器发送聊天请求：\n\n```bash\ncurl http:\u002F\u002Flocalhost:23333\u002Fv1\u002Fchat\u002Fcompletions \\\n    -H \"Content-Type: application\u002Fjson\" \\\n    -d '{\n    \"model\": \"internlm3-8b-instruct\",\n    \"messages\": [\n    {\"role\": \"user\", \"content\": \"请告诉我上海的五个景点\"}\n    ]\n    }'\n```\n\n更多详细信息请参阅 [LMDeploy 文档](https:\u002F\u002Flmdeploy.readthedocs.io\u002Fen\u002Flatest\u002F)\n\n#### SGLang 推理\n\n##### 安装\n\n```bash\npip3 install \"sglang[srt]>=0.4.1.post6\" --find-links https:\u002F\u002Fflashinfer.ai\u002Fwhl\u002Fcu124\u002Ftorch2.4\u002Fflashinfer\u002F\n```\n\n##### 兼容 OpenAI 的服务器\n\n```bash\npython3 -m sglang.launch_server --model internlm\u002Finternlm3-8b-instruct --trust-remote-code --chat-template internlm2-chat\n```\n\n##### OpenAI 客户端\n\n```python3\nimport openai\nclient = openai.Client(\n    base_url=\"http:\u002F\u002F127.0.0.1:30000\u002Fv1\", api_key=\"EMPTY\")\n\n# 聊天完成\nresponse = client.chat.completions.create(\n    model=\"default\",\n    messages=[\n        {\"role\": \"system\", \"content\": \"你是一个有用的AI助手\"},\n        {\"role\": \"user\", \"content\": \"请列出3个国家及其首都。\"},\n    ],\n    temperature=0,\n    max_tokens=64,\n)\nprint(response)\n```\n\n#### Ollama 推理\n\n安装 Ollama 并拉取模型\n\n```bash\n# 安装 Ollama\ncurl -fsSL https:\u002F\u002Follama.com\u002Finstall.sh | sh\n# 拉取模型\nollama pull internlm\u002Finternlm3-8b-instruct\n# 安装 ollama-python\npip install ollama\n```\n\n推理代码：\n\n```python\nimport ollama\n\nsystem_prompt = \"\"\"你是一个名为 InternLM（书生·浦语）的AI助手。\n- InternLM（书生·浦语）是由上海人工智能实验室开发的对话式语言模型。它旨在做到有用、诚实和无害。\n- InternLM（书生·浦语）能够理解并流利地使用用户选择的语言进行交流，例如英语和中文。\"\"\"\n\nmessages = [\n    {\n        \"role\": \"system\",\n        \"content\": system_prompt,\n    },\n    {\n        \"role\": \"user\",\n        \"content\": \"请告诉我上海的五个景点\"\n    },\n]\n\nstream = ollama.chat(\n    model='internlm\u002Finternlm3-8b-instruct',\n    messages=messages,\n    stream=True,\n)\n\nfor chunk in stream:\n  print(chunk['message']['content'], end='', flush=True)\n```\n\n#### vLLM 推理\n\n参考 [安装指南](https:\u002F\u002Fdocs.vllm.ai\u002Fen\u002Flatest\u002Fgetting_started\u002Finstallation\u002Findex.html) 安装最新版本的 vLLM。\n\n```bash\npip install vllm --pre --extra-index-url https:\u002F\u002Fwheels.vllm.ai\u002Fnightly\n```\n\n推理代码：\n\n```python\nfrom vllm import LLM, SamplingParams\nllm = LLM(model=\"internlm\u002Finternlm3-8b-instruct\")\nsampling_params = SamplingParams(temperature=1, repetition_penalty=1.005, top_k=40, top_p=0.8)\nsystem_prompt = \"\"\"你是一个名为 InternLM（书生·浦语）的AI助手。\n- InternLM（书生·浦语）是由上海人工智能实验室开发的对话式语言模型。它旨在做到有用、诚实和无害。\n- InternLM（书生·浦语）能够理解并流利地使用用户选择的语言进行交流，例如英语和中文。\"\"\"\nprompts = [\n    {\n        \"role\": \"system\",\n        \"content\": system_prompt,\n    },\n    {\n        \"role\": \"user\",\n        \"content\": \"请告诉我上海的五个景点\"\n    },\n]\noutputs = llm.chat(prompts,\n                   sampling_params=sampling_params,\n                   use_tqdm=False)\nprint(outputs)\n```\n\n### 思维模式\n\n#### 思维演示\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_readme_1f2ca08cdd66.png\" width=\"400\"\u002F>\n\n#### 思维系统提示\n\n```python\nthinking_system_prompt = \"\"\"你是一位在数学竞赛领域经验丰富的专家级数学家。你通过系统性思考和严谨的推理来解决问题。解题时，请遵循以下思维流程：\n## 深度理解\n在尝试解题之前，花时间充分理解问题。考虑以下几点：\n- 问题真正想问的是什么？\n- 已知条件是什么？它们告诉我们什么？\n- 是否存在特殊的限制或假设？\n- 哪些信息是关键的，哪些是辅助性的？\n## 多角度分析\n在解题前，进行全面的分析：\n- 涉及哪些数学概念和性质？\n- 是否能回忆起类似的经典问题或解题方法？\n- 是否可以借助图表或表格来更直观地理解问题？\n- 是否存在需要单独考虑的特殊情况？\n## 系统性思考\n规划你的解题路径：\n- 提出多种可能的解题思路\n- 分析每种方法的可行性和优势\n- 选择最合适的方法，并说明理由\n- 将复杂问题分解为更小、易于管理的步骤\n\n## 严谨证明\n在解题过程中：\n- 对每一步骤提供充分的依据\n- 对关键结论进行详细证明\n- 注意逻辑联系\n- 警惕可能出现的疏漏\n## 多次验证\n完成解答后：\n- 验证结果是否满足所有条件\n- 检查是否有遗漏的特殊情况\n- 思考解法是否可以优化或简化\n- 回顾自己的推理过程\n请记住：\n1. 不要急于求成，花时间深入思考\n2. 严谨地证明每一个关键结论\n3. 保持开放心态，尝试不同的解题方法\n4. 总结有价值的解题技巧\n5. 保持健康的怀疑态度，多次验证\n你的回答应体现出深厚的数学理解和严密的逻辑思维，使解题思路和推理过程清晰明了。\n当你准备好时，请提交完整的解答，包括：\n- 清晰的题目理解\n- 详细的解题过程\n- 关键见解\n- 全面的验证\n重点在于思路的清晰逻辑性和对数学推理的详尽解释。请使用提问者所用的语言作答，并在最后用“\\boxed{}”格式重复最终答案，且不带单位。你有[[8192]]个token来完成作答。\n\"\"\"\n```\n\n#### Transformers推理\n\n```python\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForCausalLM\nmodel_dir = \"internlm\u002Finternlm3-8b-instruct\"\ntokenizer = AutoTokenizer.from_pretrained(model_dir, trust_remote_code=True)\n# 设置`torch_dtype=torch.float16`以加载半精度浮点数模型，否则将加载为单精度浮点数，可能导致显存不足错误。\nmodel = AutoModelForCausalLM.from_pretrained(model_dir, trust_remote_code=True, torch_dtype=torch.float16)\n# （可选）如果在资源有限的设备上运行，可以通过bitsandbytes库以4位或8位精度进一步节省显存。\n  # InternLM3 8B以4位精度运行时，大约需要8GB显存。\n  # pip install -U bitsandbytes\n  # 8位：model = AutoModelForCausalLM.from_pretrained(model_dir, device_map=\"auto\", trust_remote_code=True, load_in_8bit=True)\n  # 4位：model = AutoModelForCausalLM.from_pretrained(model_dir, device_map=\"auto\", trust_remote_code=True，load_in_4bit=True)\nmodel = model.eval()\nmessages = [\n    {\"role\": \"system\", \"content\": thinking_system_prompt},\n    {\"role\": \"user\", \"content\": \"已知函数\\(f(x)=\\mathrm{e}^{x}-ax - a^{3}\\)，\\n(1) 当 \\(a = 1\\) 时，求曲线 \\(y = f(x)\\) 在点 \\((1,f(1))\\) 处的切线方程。\\n(2) 若 \\(f(x)\\) 存在局部极小值且极小值小于 \\(0\\)，求 \\(a\\) 的取值范围。\"},\n ]\ntokenized_chat = tokenizer.apply_chat_template(messages，tokenize=True，add_generation_prompt=True，return_tensors=\"pt\")\ngenerated_ids = model.generate(tokenized_chat，max_new_tokens=8192)\ngenerated_ids = [\n    output_ids[len(input_ids):] for input_ids，output_ids in zip(tokenized_chat，generated_ids)\n]\nprompt = tokenizer.batch_decode(tokenized_chat)[0]\nprint(prompt)\nresponse = tokenizer.batch_decode(generated_ids)[0]\nprint(response)\n```\n\n#### LMDeploy推理\n\nLMDeploy是一个用于压缩、部署和推理大型语言模型的工具包。\n\n```bash\npip install lmdeploy\n```\n\n你可以使用以下Python代码在本地进行批量推理：\n\n```python\nfrom lmdeploy import pipeline，GenerationConfig，ChatTemplateConfig\nmodel_dir = \"internlm\u002Finternlm3-8b-instruct\"\nchat_template_config = ChatTemplateConfig(model_name='internlm3')\npipe = pipeline(model_dir，chat_template_config=chat_template_config)\nmessages = [\n        {\"role\": \"system\", \"content\": thinking_system_prompt},\n        {\"role\": \"user\", \"content\": \"已知函数\\(f(x)=\\mathrm{e}^{x}-ax - a^{3}\\)，\\n(1) 当 \\(a = 1\\) 时，求曲线 \\(y = f(x)\\) 在点 \\((1,f(1))\\) 处的切线方程；\\n(2) 若 \\(f(x)\\) 有极小值且极小值小于 \\(0\\)，求 \\(a\\) 的取值范围。\"},\n]\nresponse = pipe(messages，gen_config=GenerationConfig(max_new_tokens=2048))\nprint(response)\n```\n\n#### SGLang推理\n\n安装\n\n```bash\npip3 install \"sglang[srt]>=0.4.1.post6\" --find-links https:\u002F\u002Fflashinfer.ai\u002Fwhl\u002Fcu124\u002Ftorch2.4\u002Fflashinfer\u002F\n```\n\n关于离线引擎API的使用，请参考[离线引擎API](https:\u002F\u002Fdocs.sglang.ai\u002Fbackend\u002Foffline_engine_api.html)\n\n#### Ollama推理\n\n安装Ollama并拉取模型\n\n```bash\n# 安装Ollama\ncurl -fsSL https:\u002F\u002Follama.com\u002Finstall.sh | sh\n# 拉取模型\nollama pull internlm\u002Finternlm3-8b-instruct\n# 安装ollama-python\npip install ollama\n```\n\n推理代码：\n\n```python\nimport ollama\n\nmessages = [\n    {\n        \"role\": \"system\",\n        \"content\": thinking_system_prompt,\n    },\n    {\n        \"role\": \"user\",\n        \"content\": \"已知函数\\(f(x)=\\mathrm{e}^{x}-ax - a^{3}\\)。\\n（1）当\\(a = 1\\)时，求曲线\\(y = f(x)\\)在点\\((1,f(1))\\)处的切线方程；\\n（2）若\\(f(x)\\)有极小值，且极小值小于\\(0\\)，求\\(a\\)的取值范围。\"\n    },\n]\n\nstream = ollama.chat(\n    model='internlm\u002Finternlm3-8b-instruct',\n    messages=messages，\n    stream=True，\n    options=dict(num_ctx=8192，num_predict=2048)\n)\n\nfor chunk in stream:\n  print(chunk['message']['content'], end='', flush=True)\n```\n\n#### vLLM推理\n\n请参考[安装指南](https:\u002F\u002Fdocs.vllm.ai\u002Fen\u002Flatest\u002Fgetting_started\u002Finstallation\u002Findex.html)以安装最新版本的vLLM。\n\n```python\npip install vllm --pre --extra-index-url https:\u002F\u002Fwheels.vllm.ai\u002Fnightly\n```\n\n推理代码：\n\n```python\nfrom vllm import LLM，SamplingParams\nllm = LLM(model=\"internlm\u002Finternlm3-8b-instruct\")\nsampling_params = SamplingParams(temperature=1，repetition_penalty=1.005，top_k=40，top_p=0.8，max_tokens=8192)\nprompts = [\n    {\n        \"role\": \"system\",\n        \"content\": thinking_system_prompt,\n    },\n    {\n        \"role\": \"user\",\n        \"content\": \"已知函数\\(f(x)=\\mathrm{e}^{x}-ax - a^{3}\\)，\\n(1) 当 \\(a = 1\\) 时，求曲线 \\(y = f(x)\\) 在点 \\((1,f(1))\\) 处的切线方程；\\n(2) 若 \\(f(x)\\) 有局部极小值且极小值小于 \\(0\\)，求 \\(a\\) 的取值范围。\"\n    },\n]\noutputs = llm.chat(prompts，\n                   sampling_params=sampling_params，\n                   use_tqdm=False)\nprint(outputs)\n```\n\n## 许可证\n\n代码和模型权重采用Apache-2.0许可证。\n\n## 引用\n\n```\n@misc{cai2024internlm2,\n      title={InternLM2 技术报告},\n      author={蔡铮、曹茂松、陈浩炯、陈凯、陈科宇、陈鑫、陈勋、陈泽辉、陈志、褚沛、董晓毅、段浩东、范琪、费兆业、高阳、葛嘉烨、顾晨雅、顾宇哲、桂涛、郭艾佳、郭启鹏、何聪辉、胡英凡、黄婷、蒋涛、焦鹏龙、金振江、雷志凯、李家兴、李静雯、李林洋、李帅斌、李伟、李怡宁、刘洪伟、刘江宁、刘嘉伟、刘凯文、刘奎坤、刘潇然、吕成奇、吕海俊、吕凯、马莉、马润元、马泽润、宁文昌、欧阳林科、邱建涛、曲源、尚福凯、邵云帆、宋德民、宋子凡、隋志豪、孙鹏、孙宇、唐焕泽、王彬、王国腾、王佳琪、王嘉宇、王锐、王宇东、王梓伊、魏星健、翁齐珍、吴凡、熊颖彤、徐超、徐瑞良、闫航、严一荣、杨小贵、叶浩辰、应怀远、于佳、于晶、臧宇航、张楚宇、张力、张盼、张鹏、张睿杰、张硕、张松阳、张文健、张文伟、张星程、张欣悦、赵辉、赵倩、赵晓梦、周峰哲、周再达、卓景明、邹义成、邱锡鹏、乔宇、林大华},\n      year={2024},\n      eprint={2403.17297},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL}\n}\n```","# InternLM 快速上手指南\n\nInternLM 是由上海人工智能实验室开源的一系列大语言模型。最新发布的 **InternLM3-8B-Instruct** 在推理和知识密集型任务上表现卓越，且支持“深度思考”模式。本指南将帮助您快速在本地部署并使用该模型。\n\n## 1. 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**: Linux (推荐 Ubuntu 20.04+) 或 macOS\n*   **Python**: 3.8 或更高版本\n*   **GPU**: 推荐使用 NVIDIA GPU (显存要求：8B 模型推理建议至少 16GB，量化后可降低)\n*   **包管理器**: pip 或 conda\n\n**前置依赖安装：**\n建议使用 `pip` 安装核心依赖库 `transformers` 和 `accelerate`。国内用户推荐使用清华源或阿里源加速下载。\n\n```bash\npip install transformers accelerate torch -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n## 2. 安装与模型下载\n\nInternLM 模型托管在 Hugging Face 和 ModelScope（魔搭）上。**强烈建议国内开发者使用 ModelScope 下载模型**，以获得更快的下载速度。\n\n### 方案 A：使用 ModelScope 下载（推荐）\n\n首先安装 ModelScope 库：\n\n```bash\npip install modelscope -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n使用 Python 脚本下载最新的 **InternLM3-8B-Instruct** 模型：\n\n```python\nfrom modelscope import snapshot_download\n\nmodel_dir = snapshot_download('Shanghai_AI_Laboratory\u002Finternlm3-8b-instruct', cache_dir='.\u002Fmodels')\nprint(f\"Model downloaded to: {model_dir}\")\n```\n\n### 方案 B：使用 Hugging Face 下载\n\n如果您网络环境允许，也可以直接使用 `git-lfs` 或 `huggingface-cli`：\n\n```bash\ngit lfs install\ngit clone https:\u002F\u002Fhuggingface.co\u002Finternlm\u002Finternlm3-8b-instruct\n```\n\n## 3. 基本使用\n\n以下是最简单的使用示例，展示如何加载模型并进行对话推理。此代码适用于 InternLM3 及 InternLM2.5 系列 Chat 模型。\n\n```python\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForCausalLM\n\n# 1. 指定模型路径 (如果是用 ModelScope 下载，填写上面的 model_dir 路径)\nmodel_path = \".\u002Fmodels\u002FShanghai_AI_Laboratory\u002Finternlm3-8b-instruct\" \n# 或者直接使用 HuggingFace ID (需联网): \"internlm\u002Finternlm3-8b-instruct\"\n\n# 2. 加载分词器和模型\n# trust_remote_code=True 是加载 InternLM 模型的必要参数\ntokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)\nmodel = AutoModelForCausalLM.from_pretrained(\n    model_path, \n    torch_dtype=torch.float16, # 使用半精度节省显存\n    device_map=\"auto\",         # 自动分配设备\n    trust_remote_code=True\n)\nmodel.eval()\n\n# 3. 构建对话历史\n# InternLM3 支持深度思考模式，可通过特定 prompt 触发，此处展示标准对话\nhistory = []\nquery = \"请简要介绍一下量子纠缠。\"\n\n# 4. 生成回复\nresponse, history = model.chat(tokenizer, query, history=history)\n\nprint(\"AI 回复:\", response)\n```\n\n### 进阶：开启深度思考模式\nInternLM3 支持通过提示词触发长思维链（Chain-of-Thought）模式以解决复杂问题。您只需在输入中加入特定指令即可：\n\n```python\nquery = \"请逐步思考并解答：如果一个池塘里的睡莲每天面积扩大一倍，30 天铺满池塘，那么铺满一半需要多少天？\"\nresponse, history = model.chat(tokenizer, query, history=history)\nprint(response)\n```\n\n> **注意**：运行 8B 模型时，若显存不足，可尝试添加 `load_in_8bit=True` 参数（需安装 `bitsandbytes`）进行量化加载。","某金融科技公司量化团队正试图构建一个自动化研报分析系统，需要从海量财经新闻和财报中提取关键数据并推导投资逻辑。\n\n### 没有 InternLM 时\n- **推理深度不足**：通用模型在处理复杂的财务因果链时往往浅尝辄止，无法像人类分析师那样进行多步逻辑推演，导致结论缺乏说服力。\n- **训练成本高昂**：为了达到可用的专业精度，团队需耗费巨额算力训练或微调大参数模型，预算严重超支且周期漫长。\n- **响应模式单一**：模型只能在“快速回答”和“深度思考”间二选一，无法根据问题复杂度动态切换，既浪费资源又影响用户体验。\n- **知识更新滞后**：面对最新的金融市场动态和术语，旧模型泛化能力差，频繁出现幻觉或过时信息，需人工反复校验。\n\n### 使用 InternLM 后\n- **深度思维激活**：利用 InternLM3 的长链条思维（Chain-of-Thought）模式，模型能自动拆解复杂财务问题，逐步推导出的投资逻辑准确率显著提升。\n- **降本增效显著**：得益于仅用 4 万亿高质量令牌训练即超越同规模竞品，团队以节省 75% 的训练成本获得了更优的推理性能。\n- **双模灵活切换**：InternLM 支持在“深度思考”与“流畅交互”间智能切换，简单查询秒级响应，复杂研判则自动进入深度分析模式。\n- **前沿知识覆盖**：基于最新训练数据，InternLM 对新兴金融概念理解精准，大幅减少了事实性错误，人工复核工作量降低 80%。\n\nInternLM 以极低的训练成本赋予了业务系统专家级的深度推理能力，真正实现了高性能与低消耗的完美平衡。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FInternLM_InternLM_375e99f5.png","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FInternLM_bc4eb14c.png","",null,"internlm@pjlab.org.cn","intern_lm","https:\u002F\u002Fchat.intern-ai.org.cn\u002F","https:\u002F\u002Fgithub.com\u002FInternLM",[80],{"name":81,"color":82,"percentage":83},"Python","#3572A5",100,7182,510,"2026-04-07T10:30:43","Apache-2.0","未说明","未说明（模型参数量涵盖 1.8B 至 20B，实际显存需求取决于具体模型版本及是否量化，通常 7B 模型需 14GB+ 显存，20B 模型需 40GB+ 显存）",{"notes":91,"python":88,"dependencies":92},"README 主要介绍模型特性及下载链接，未直接列出具体的运行环境配置（如 Python 版本、CUDA 版本等）。模型提供 HuggingFace (transformers) 和 InternEvo (Origin) 两种格式。其中 InternLM3-8B-Instruct 为最新发布的指令微调模型，支持深度思考模式；InternLM2.5 系列包含基础版、聊天版及支持 1M 长上下文的版本。用户需根据所选模型大小（1.8B\u002F7B\u002F8B\u002F20B）自行评估硬件资源。",[93,94,95],"transformers","InternEvo","OpenCompass",[13,14,35],[98,99,100,101,102,103,104,105,106,107],"chatbot","gpt","large-language-model","long-context","rlhf","fine-tuning-llm","llm","chinese","flash-attention","pretrained-models","2026-03-27T02:49:30.150509","2026-04-08T05:09:00.431934",[111,116,121,126,131,136],{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},23803,"在 Windows 11 上使用 bitsandbytes 运行 InternLM2-chat-7B-4bits 量化模型时，模型输出混乱并重复内容，如何解决？","该问题通常与量化库 bitsandbytes 在 Windows 环境下的兼容性或推理参数设置有关。虽然原 Issue 因超时无回复被关闭，但建议检查以下几点：1. 确保使用的是支持 Windows 的 bitsandbytes 版本（官方主要支持 Linux，Windows 可能需要特定构建或改用其他量化方案如 lmdeploy）；2. 尝试调整生成参数，如设置 `repetition_penalty` (重复惩罚) 大于 1，限制 `max_new_tokens`，并检查 `temperature` 设置；3. 如果可能，建议在 Linux 环境下运行或使用 Docker 容器以避免系统兼容性问题。","https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fissues\u002F680",{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},23804,"在 config.py 中将 use_flash_attn 设置为 False 后训练报错，应该如何处理？","当关闭 flash_attn 时出现错误，通常是因为代码中某些部分仍依赖 flash_attn 的算子或精度不匹配。解决方案包括：1. 将模型精度调整为 `torch.float16`，因为在某些配置下 `bfloat16` 可能在非 flash_attn 路径下支持不佳；2. 检查是否还有其他算子（如 parallelLinear）隐式调用了 flash_attn 的功能，如果是旧架构 GPU（如 Volta），可能需要进一步调试线性层调用；3. 确保配置文件中的 `dtype` 明确指定为支持的类型，例如：`dtype=\"torch.float16\"`。","https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fissues\u002F572",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},23805,"InternLM2-1.8B 模型是否已经发布？在哪里可以下载？","是的，InternLM2-1.8B 模型已经开源。您可以在 Hugging Face 上找到以下两个模型权重：1. 基座模型：internlm\u002Finternlm2-1_8b；2. 对话微调模型：internlm\u002Finternlm2-chat-1_8b-sft。这两个模型适合显存较低的设备使用，加载速度快，也适合移动端部署。","https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fissues\u002F609",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},23806,"使用 lmdeploy serve api_server 发布 internlm2_5-7b-chat 服务时，调用出现重复生成现象，如何解决？","重复生成通常是由于采样参数设置不当或会话状态未正确重置导致的。建议尝试以下调整：1. 在请求参数中增加 `repetition_penalty`（例如设为 1.1 或更高）以抑制重复；2. 降低 `temperature`（如 0.3-0.7）并适当减小 `top_p`；3. 确保每次新对话时使用新的 `session_id` 或在服务端重启会话，避免上下文污染；4. 检查 `max_tokens` 是否设置合理，避免模型因未达到停止条件而强行续写。","https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fissues\u002F758",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},23807,"执行 model.chat() 时报错 'RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:1'，原因是什么？","该错误表明模型推理过程中，参与计算的张量分布在不同的 GPU 设备上（例如一部分在 cuda:0，另一部分在 cuda:1）。常见原因及解决方法：1. 确保模型和输入数据都在同一个设备上，使用 `.cuda()` 或 `.to('cuda:0')` 显式指定设备；2. 如果使用了多卡并行，检查是否错误地混合了单卡推理代码；3. 在使用 `transformers` 加载模型时，确认 `device_map` 参数设置正确，或者手动将 tokenizer 生成的 input_ids 移动到模型所在的设备，例如：`input_ids = input_ids.to(model.device)`。","https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fissues\u002F575",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},23808,"如何获取书生·浦语的邀请码？填写后无法使用怎么办？","关于书生·浦语平台的邀请码，通常需要通过官方活动、社区申请或联系维护者获取。如果在 GitHub Issue 中直接请求，可能无法及时获得响应。若已获取邀请码但仍无法使用，可能是以下原因：1. 邀请码已过期或被多次使用失效；2. 账号注册信息与邀请码不匹配；3. 平台服务器暂时故障。建议检查邮箱收到的官方说明，或直接在书生·浦语官网寻找最新的申请入口，不要在公开的 GitHub Issue 中泄露个人邮箱以免收到垃圾邮件。","https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fissues\u002F766",[142,147,152,157,162,167,172,177],{"id":143,"version":144,"summary_zh":145,"released_at":146},145361,"v0.2.1dev20240102","## 变更内容\n* 修复（超时）：@JiaoPL 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F495 中增加了超时时间\n* 功能（文档）：@li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F507 中为 7B 和 20B 模型添加了 GPU 内存信息\n* 功能（模型）：@00INDEX 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F512 中添加了 rope_base 接口\n* 功能（QA）：检查 micro_num 和 micro_bsz 互换时的损失 && 检查梯度范数，由 @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F510 中实现\n* 修复（QA）：主程序中的 Python 文件名错误，由 @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F514 中修复\n* 修复\u002F功能：小幅修复与增强，由 @SolenoidWGT 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F515 中完成\n* 测试（工作流）：添加损失测试的工作流并更改触发事件，由 @kkscilife 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F513 中实现\n* 修复（CI）：修复测试模型检查点的 CI 测试，由 @SolenoidWGT 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F518 中完成\n* 测试（工作流）：添加单元测试用例，由 @kkscilife 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F524 中完成\n* 功能（存储）：使用 OSS 时采用分片上传，由 @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F520 中实现\n* 修复（QA 检查点）：修复 test_model_checkpoint 单例导入问题，由 @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F526 中完成\n* 修复（模型）：为归一化模块添加 IS_SEQUENCE_PARALLEL 检查，由 @yingtongxiong 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F528 中完成\n* 功能（模型）：添加输出嵌入 tf32 选项，由 @JiaoPL 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F523 中实现\n* 功能（梯度范数）：词汇表梯度范数分析，由 @JiaoPL 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F519 中实现\n* 修复（数据）：修复 use_flash_attn=False 时 type_ids 的解包问题，由 @yingtongxiong 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F516 中完成\n* 修复（存储）：统一 AK 和 SK 的名称，由 @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F527 中完成\n* 修复（测试）：修复 type_ids 解包 bug，由 @SolenoidWGT 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F530 中完成\n* 功能（模型）：支持加载检查点的 Llama 模型，由 @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F532 中实现\n* 修复（指标）：添加指标数据类型控制，由 @Pryest 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F533 中完成\n* 功能（检查点）：支持在 Volc 和 Ali 平台上的自动恢复，由 @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F529 中实现\n* 修复（序列并行）：修复序列并行模式下非重叠情况下的归一化 all-reduce 问题，由 @yingtongxiong 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F534 中完成\n* 修复（Pipeline Parallelism）：修复未打包数据集加载微批次时的错误，由 @SolenoidWGT 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F538 中完成\n* 修复（模型）：将 model_type 从 `LLAMA` 改为 `LLAMA2`，由 @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F539 中完成\n* 修复（Moe）：修复 Moe 零模式的 bug，由 @blankde 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F548 中完成\n* 修复（梯度范数）：在 TP 下计算 token 梯度范数，由 @JiaoPL 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F547 中完成\n* 测试（工作流）：改为预留状态，由 @kkscilife 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F550 中完成\n* 修复（模型）：添加检查点","2024-01-02T05:05:11",{"id":148,"version":149,"summary_zh":150,"released_at":151},145362,"v0.2.1dev20231121","待定","2023-11-21T09:00:34",{"id":153,"version":154,"summary_zh":155,"released_at":156},145363,"v0.2.1dev20230915","## 亮点\n* 修复 total_steps 较小时可能导致梯度溢出的 bug\n* 修复 tool convert2hf.py 中 rotary_emb.inv_freq 的 KeyError\n* 添加模型单元测试\n\n## 变更内容\n\n### 🚀 功能\n* feat(core\u002Ftrainer.py): 增加更多 tgs 指标，由 @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F310 中实现\n\n### 🐞 Bug 修复\n* fix(convert2hf.py): 修复 rotary_emb.inv_freq 的 KeyError，由 @jiangtann 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F299 中完成\n* fix(configs\u002F7B_sft.py): 将模型数据类型从 float16 改为 bfloat16，由 @huangting4201 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F302 中完成\n* fix(chat): 修复 stream_chat 返回生成器的问题，由 @zhjunqin 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F123 中完成\n\n### 📚 文档\n* docs(doc\u002Fcode-docs): 更新快速入门使用说明，由 @huangting4201 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F301 中完成\n* docs(doc\u002Fcode-docs): 为训练文档添加示意图，由 @zigzagcai 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F307 中完成\n\n### ✅ 测试\n* tests(tests\u002Ftest_model): 添加模型单元测试，由 @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F300 中完成\n* tests(tests\u002Ftest_solver): 添加优化器单元测试，由 @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F303 中完成\n\n### 🌐 其他\n\n## 已知问题\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fcompare\u002Fv0.2.1dev20230909...v0.2.1dev20230915","2023-09-15T11:31:08",{"id":158,"version":159,"summary_zh":160,"released_at":161},145364,"v0.2.1dev20230909","## 变更内容\n* 修复（ckpt）：修复快照加载为空的错误，并移除文件锁，由 @SolenoidWGT 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F298 中完成。\n\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fcompare\u002Fv0.2.1dev20230908...v0.2.1dev20230909","2023-09-08T12:45:56",{"id":163,"version":164,"summary_zh":165,"released_at":166},145365,"v0.2.1dev20230908","## 亮点\n* 修复在反向传播时与梯度的 allreduce 操作重叠可能导致 NaN 值的 bug\n* 支持超时包装器和运行时诊断功能\n* 支持 Read the Docs 中文版\n\n## 变更内容\n\n### 🚀 功能\n* feat(monitor): @JiaoPL 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F275 中添加了轻量级监控功能\n* feat(utils): @SolenoidWGT 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F286 中添加了超时包装器\n* feat: @sunpengsdu 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F297 中添加了运行时诊断功能\n\n### 💥 改进\n* fix(storage): @SolenoidWGT 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F281 中重构并修复了 storage_manager API\n* Feat\u002Fsync grad use async op: @sunpengsdu 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F277 中实现了同步梯度使用异步操作的功能\n\n### 🐞 Bug 修复\n* fix(doc\u002Fcode-docs): @huangting4201 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F265 中修复了自动文档显示错误的问题\n* fix(eval): @00INDEX 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F274 中指出，在使用流式数据集时无需检查 valid_dl 的长度\n* fix\u002Fbroadcast should not in commu stream: @sunpengsdu 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F276 中修复了广播操作不应在通信流中执行的问题\n* fix(model): @yingtongxiong 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F271 中为 MLP 设置了张量并行属性\n* feat(ckpt): @SolenoidWGT 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F259 中修复了检查点相关问题并增强了功能\n* fix(ckpt): @SolenoidWGT 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F282 中修复了检查点重新加载的 bug\n* fix(core\u002Fcontext): @blankde 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F266 中提出在模型构建时使用虚拟模式生成随机数\n* fix(monitor): @JiaoPL 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F285 中添加了告警开关并重构了监控配置\n* fix: @sunpengsdu 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F294 中修复了在流中执行广播操作的 bug\n\n### 📚 文档\n* docs(*): @zigzagcai 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F272 中添加了用于 Read the Docs 的文档和 reST 文件\n* docs(doc\u002Fcode-docs): @huangting4201 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F289 中支持了中文版 Read the Docs\n* docs(fsdp): @zaglc 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F273 中增加了 FSDP 的训练选项\n* docs(doc\u002Fcode-docs): @zigzagcai 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F295 中完善了性能分析器的相关文档\n\n### 🌐 其他\n\n## 已知问题\n\n## 新贡献者\n* @JiaoPL 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F275 中做出了首次贡献\n* @blankde 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F266 中做出了首次贡献\n* @zigzagcai 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F272 中做出了首次贡献\n* @zaglc 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F273 中做出了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fcompare\u002Fv0.2.1dev20230901...v0.2.1dev20230908","2023-09-08T10:12:09",{"id":168,"version":169,"summary_zh":170,"released_at":171},145366,"v0.2.1dev20230901","## 亮点\n* 支持 CentOS 和 Ubuntu 的 Dockerfile\n* 支持运行时 GPU 浮点运算性能和 NCCL AllReduce 速度测试\n\n## 变更内容\n\n### 🚀 功能\n* @Pryest 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F252 中实现了张量的 uniform 初始化\n* @li126com 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F220 和 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F243 中支持了 CentOS 和 Ubuntu 的 Dockerfile\n* @huangting4201 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F257 中支持了 writer 的 `add_scalars` 方法，用于写入字典数据\n* @sunpengsdu 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F254 中支持了运行时 GPU 浮点运算性能和 NCCL AllReduce 速度测试\n\n### 💥 改进\n-\n\n### 🐞 Bug 修复\n* @00INDEX 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F251 中修复了 StreamingDataset 没有 `len` 方法的问题\n* @MagicDevilZhang 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F256 中修复了获取损失指标时参数缺失的问题\n* @YWMditto 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F239 中修复了 RotaryEmbedding 在操作过程中被转换为非 fp32 格式导致的错误\n\n### 📚 文档\n* @huangting4201 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F240 中更新了 README 的结构\n* @huangting4201 在 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F245 和 https:\u002F\u002Fgithub.com\u002FInternLM\u002FInternLM\u002Fpull\u002F264 中支持了 ReadTheDocs\n\n### 🌐 其他\n-\n\n### 已知问题\n-","2023-09-01T09:27:25",{"id":173,"version":174,"summary_zh":175,"released_at":176},145367,"v0.2.0","**功能：**\n1. 支持流水线并行，包括交错式和非交错式流水线调度器。\n2. 支持序列并行。\n3. 支持模型评估。\n4. 支持使用 TF32 格式与 Flash Attention。\n5. 支持 TensorBoard 写入器，用于记录训练性能指标。\n6. 支持自定义的统一日志记录器。\n7. 支持计算模型的准确率和困惑度指标。\n8. 支持 OSS 存储及检查点异步上传。\n9. 支持自动加载最新的检查点。\n10. 支持检查点快照。\n11. 支持监控训练任务的状态，并对异常状态进行报警。\n12. 支持 PyTorch 分析器。\n13. 支持简单的内存分析器。\n\n**优化：**\n1. 将优化器参数广播与模型前向计算重叠执行。\n2. 将优化器最后一个桶的梯度 AllReduce 操作与范数计算重叠执行。","2023-08-24T14:07:11",{"id":178,"version":179,"summary_zh":74,"released_at":180},145368,"v0.1.0","2023-08-24T05:45:27"]