[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-thunlp--WebCPM":3,"tool-thunlp--WebCPM":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":80,"owner_twitter":79,"owner_website":81,"owner_url":82,"languages":83,"stars":112,"forks":113,"last_commit_at":114,"license":115,"difficulty_score":116,"env_os":117,"env_gpu":118,"env_ram":117,"env_deps":119,"category_tags":124,"github_topics":79,"view_count":10,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":125,"updated_at":126,"faqs":127,"releases":168},2358,"thunlp\u002FWebCPM","WebCPM","Official codes for ACL 2023 paper \"WebCPM: Interactive Web Search for Chinese Long-form Question Answering\"","WebCPM 是一个专为中文长篇幅问答任务设计的开源项目，源自 ACL 2023 的研究成果。它核心解决了大模型在面对复杂中文问题时，因缺乏实时信息或领域知识而导致回答不准确、内容单薄的问题。通过模拟人类“搜索 - 阅读 - 总结”的交互过程，WebCPM 能够主动进行网络搜索，收集相关事实依据，并据此生成详实、可信的长篇回答。\n\n该项目特别适合自然语言处理领域的研究人员和开发者使用。它不仅提供了完整的代码实现和数据集，还开放了基于 CPM-bee 架构的百亿参数中文预训练模型权重，方便用户复现论文结果或进行二次开发。此外，项目包含一个可收集人类搜索行为数据的网页接口，为研究人类如何高效利用搜索引擎提供了宝贵资源。\n\nWebCPM 的技术亮点在于其“交互式网络搜索”机制。不同于传统的单次检索，它能像人类专家一样多轮次地发起查询、筛选信息，并将获取的知识融入生成过程。这种机制显著提升了模型在处理需要多方验证或深度背景知识的复杂问题时的表现，是推动中文大模型具备更强工具使用能力和事实准确性的重要探索。","\u003Cdiv align=\"center\">\n\n\u003Ch1>WebCPM\u003C\u002Fh1>\n\n\u003C\u002Fdiv>\n\n✨ This is the implementation of ACL 2023 paper [Interactive Web Search for Chinese Long-form Question Answering](https:\u002F\u002Farxiv.org\u002Fabs\u002F2305.06849)\n\n![paper](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthunlp_WebCPM_readme_760d526a75b4.png)\n\n*Read this in [中文](README_zh.md).*\n\n---\n\n\n## Quick links\n\n- [Quick links](#quick-links)\n- [Overview](#overview)\n- [Requirements](#requirements)\n- [Preparation](#preparation)\n  - [Prepare the Data](#prepare-the-data)\n  - [Prepare the model](#prepare-the-model)\n- [Train WebCPM](#train-webcpm)\n  - [A brief Introduction of Pipeline-based Web Search](#a-brief-introduction-of-pipeline-based-web-search)\n  - [Data Preprocessing](#data-preprocessing)\n    - [Training Data Generation of Interactive Web Search](#training-data-generation-of-interactive-web-search)\n    - [Training Data Generation of Pipeline-based Web Search](#training-data-generation-of-pipeline-based-web-search)\n  - [Training](#training)\n- [Single-task Evaluation](#single-task-evaluation)\n- [Run WebCPM for New Questions](#run-webcpm-for-new-questions)\n  - [Interactive Web Search](#interactive-web-search)\n  - [Pipeline-based Web Search](#pipeline-based-web-search)\n- [Platform Building for Data Annotation](#platform-building-for-data-annotation)\n- [Bugs or questions?](#bugs-or-questions)\n- [Resources of Tool Learning](#resources-of-tool-learning)\n- [Citation](#citation)\n\n\n## Overview\n![platform](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthunlp_WebCPM_readme_eb6cb30d743c.png)\n\nIn this work we present WebCPM, a project for interactive Web search using Chinese Pre-trained Models. We develop a web search interface which both humans and collect human web search behaviors. Then we fine-tune PLMs with up to 10B parameters to imitate human behaviors of web search and to generate answers based on the collected facts. We open source the web search interface, dataset, implementation, and model parameters.\n\n\n## Requirements\n\nTo run our code, please install all the dependency packages by using the following command:\n\n```\npip install -r requirements.txt\n```\n\n**NOTE**: Different versions of packages (e.g., `pytorch`) may lead to different results from the paper. However, the trend should still hold no matter what versions of packages you use.\n\n## Preparation\n\n### Prepare the Data\n\nFirst download the data from [Google Drive](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F1IQBOCwhcMUnkxevv9wVFVLIFT3o8f7HX?usp=sharing), and put the files `interactive_data` and `pipeline_data` to `.\u002Fdata`, or run the following commands:\n\nThe downloaded files contain the following:\n\n`interactive_data\u002Fdata.json` is the dataset used in the experiments of the paper (**5500** instances in total).\n`interactive_data\u002Fdata_zhihu.json` is additional dataset collected alongside this paper (~**900** instances), with the question sourcing from [Zhihu](https:\u002F\u002Fwww.zhihu.com\u002Fpeople\u002F71-26-1-50), you can use this for data augmentation.\n\nPlease use the following codes to split the above data into train, dev, and test set (setting --add_zhihu will add data_zhihu.json).\n\n```bash\ncd data\u002Finteractive_data\npython split.py --add_zhihu\n```\n\nIn addition to the interactive web search data, we also provide the dataset needed for training the pipeline-based web search: `pipeline_data` (**110k** instances in total). All the data is created by prompting text-davinci-003 (Bing search engine is also involved) and then manually filtered by human annotators. (**Note** This part is not included in the paper, and you don't need to split it into train \u002F dev \u002F test.)\n\n\n### Prepare the model\n\nWebCPM is based on [CPM-bee](https:\u002F\u002Fgithub.com\u002FOpenBMB\u002FCPM-Live) with up to **10 billion** parameters, which is one of the largest Chinese pre-trained language model in the community. We use an early version of CPM-bee, which is denoted as cpm_10b_webcpm_exp.pt. The latest version of CPM-bee is hosted at [New-CPM-bee](https:\u002F\u002Fgithub.com\u002FOpenBMB\u002FCPM-Bee). You may need to replace the cpm-live package for the new version. **Note the model checkpoint has not been fine-tuned towards any downstream task**. To access cpm_10b_webcpm_exp.pt, you can download the model parameters at [Tsinghua Cloud](https:\u002F\u002Fcloud.tsinghua.edu.cn\u002Fd\u002Fa02ae00b11434c9c8560\u002F), or run the following script:\n\n```\ncd models\nbash download_model_initial_model.sh\n```\n\nThe above codes will download the 10B (non-finetuned) model at `models`, for the finetuned pipeline model, please refer to `download_model_pipeline_finetuned.sh`, or download it manually from [Tsinghua Cloud](https:\u002F\u002Fcloud.tsinghua.edu.cn\u002Fd\u002F3dc39eccc6c64bb58671\u002F).\n\n## Train WebCPM\n\n![platform](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthunlp_WebCPM_readme_54f7e0430f46.png)\n\nWe provide two versions of WebCPM: (1) interactive web search (the method proposed in the ACL paper) and (2) pipeline-based web search, which is easier to deploy (this method is not reported in the paper). Both versions use different scripts for training data generation and the same codes for model training.\n\n### A brief Introduction of Pipeline-based Web Search\n\nThe workflow follows four stages: (1) first, generate possible search queries based on the original question; (2) then for each search query, call Bing search and visit top-K web pages; (3) for each web page, extract the important information; (4) based on all the recorded information, generate a coherent and nuanced answer. All these things are trained in a multi-task way, please refer to `run_web_browsing\u002Frun_pipeline.py`. For details of the interactive web search, please refer to our original paper.\n\n### Data Preprocessing\n\nBefore you start, run the following codes:\n\n```bash\nexport PYTHONPATH=\u002F**your-base-path**\u002Fwebcpm\n```\n\nThe training data generation is as follows (we differentiate between interactive web search and pipeline-based method). The following codes will generate `train_data`, `dev_data`, and `test_data` in the corresponding folder, which will be loaded during training.\n\n#### Training Data Generation of Interactive Web Search\n\nFirst, construct the data for the synthesis model using the following codes:\n\n```bash\ncd dataset_interactive\npython make_data_synthesis_model.py --data_path ..\u002F..\u002Fdata\u002Finteractive_data  --augment_qa_data --augment_data_path ..\u002F..\u002Fdata\u002Fpipeline_data\n```\n\nWe explain some of the arguments as follows:\n\n* `data_path`: The source data path.\n* `augment_qa_data`: Whether to augment the training data with qa data automatically generated by text-davinci. (To replicate the results in our paper, do not add this argument)\n* `augment_data_path`: The data path to the augmented training data.\n\nThe training data generation of the search model is as follows:\n\n```bash\npython make_data_search_model.py --add_query --add_action --add_abstract --abstract_all_tokens\n```\n\nWe explain some of the arguments as follows:\n\n* `data_path`: The source data path.\n* `add_query`: If True, will add the query generation data.\n* `add_abstract`: If True, will add the generate supporting fact extraction data.\n* `abstract_all_tokens`: If True, supporting fact extraction module will generate all the tokens, instead of only the first \u002F last few tokens.\n* `add_action`: If True, will add the action prediction data.\n* `add_synthesis`: If True, will load local data for the synthesis model. **Note You must first run python make_data_synthesis_model.py to obtain the synthesis data then add this argument here**.\n  \nIf you want to train all sub-tasks in a multi-task way, just add all the above arguments; otherwise only add one argument (e.g., `--add_query`) for single-task testing.\n\n#### Training Data Generation of Pipeline-based Web Search\n\nPlease run the following codes:\n\n```bash\ncd dataset_pipeline\npython make_data.py\n```\n\n### Training\n\nTo train WebCPM, run the following codes:\n\n```bash\ncd training\nexport PYTHONPATH=\u002F**your-base-path**\u002Fwebcpm\nexport CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7\nGPUS_PER_NODE=$(echo $CUDA_VISIBLE_DEVICES | tr ',' '\\n' | wc -l | xargs)\necho \"Number of visible devices: $GPUS_PER_NODE, should be the same as visible devices\"\n\nset -ex\n\nMASTER_ADDR=localhost\nMASTER_PORT=3239\nNNODES=1\nNODE_RANK=0\n\nOPTS=\"\"\nOPTS+=\" --model-config config\u002Fcpm-bee-10b.json\"\nOPTS+=\" --dataset ..\u002Fdata\u002Fdataset_interactive\u002Ftrain_data\"\nOPTS+=\" --dataseteval ..\u002Fdata\u002Fdataset_interactive\u002Fdev_data\"\nOPTS+=\" --epoch 5\"\nOPTS+=\" --batch-size 8\"\nOPTS+=\" --train-iters 100\"\nOPTS+=\" --save-name webcpm_finetuned\"\nOPTS+=\" --max-length 2560\"\nOPTS+=\" --save ..\u002Fmodels\u002F\"\nOPTS+=\" --lr 0.0001\"\nOPTS+=\" --inspect-iters 100\"\nOPTS+=\" --warmup-iters 1\"\nOPTS+=\" --save-epochs 1\"\nOPTS+=\" --lr-decay-style noam\"\nOPTS+=\" --weight-decay 0.01\"\nOPTS+=\" --clip-grad 1.0\"\nOPTS+=\" --loss-scale 32768\"\nOPTS+=\" --start-step 0\"\nOPTS+=\" --load ..\u002Fmodels\u002Fcpm_10b_webcpm_exp.pt\"\n\nCMD=\"torchrun --nnodes=${NNODES} --nproc_per_node=${GPUS_PER_NODE} --rdzv_id=1 --rdzv_backend=c10d --rdzv_endpoint=${MASTER_ADDR}:${MASTER_PORT} finetune_cpm_bee.py ${OPTS}\"\n\necho ${CMD}\n$CMD\n```\n\nWe explain some of the arguments as follows:\n\n* `dataset` and `dataseteval`: The path to the processed file. For interactive web search, it is dataset_interactive, while for pipeline-based method, it is dataset_pipeline.\n* `batch-size`: The batch size of a single GPU, the real batch size will be #GPUs x batch-size per GPU.\n* `max-length`: The maximum sequence length of the data (not the model), those longer training instances will be dropped.\n* `save-name` and `save`: The path to save the fine-tuned model and the name of the saved model checkpoint.\n* `epoch`: The number of training epochs.\n* `load`: The path to the pre-trained model checkpoint (cpmb in this case).\n\nNote no matter which module you are training (or the multi-task setting), you can use the above codes. We are training on 8x80G A100, you can change the batch size according to your GPU devices, the performance is not sensitive to the hyper-parameters.\n\n## Single-task Evaluation\n\nTo evaluate different sub-tasks, you can first run the following codes to get the prediction of your fine-tuned model on the test data:\n\n```bash\ncd inference\npython inference.py --test_file ..\u002Ftraining\u002Fdataset_interactive\u002Ftest.txt --output_file output\u002Ftest_predictions.json --ckpt_path **your_finetuned_checkpoint.pt\n```\n\nWe explain some of the arguments as follows:\n\n* `test_file`: The path to the test file, it should have been generated during data preprocessing.\n* `output_file`: The path you want to write your predictions.\n* `ckpt_path`: The path to your fine-tuned model.\n\nAfter obtaining the predictions on the test file, you can run the following codes for single-task evaluation:\n\n```bash\npython evaluate.py --input_file output\u002Ftest_predictions.txt --evaluate_action\n```\n\nWe explain some of the arguments as follows:\n\n* `input_file`: The path you write your predictions of the test file.\n* `evaluate_action`: Whether you want to evaluate the action prediction task (F1).\n* `evaluate_query`: Whether you want to evaluate the search query generation task (Rougel-L).\n* `evaluate_abstract`: Whether you want to evaluate the supporting fact extraction task (Rougel-L).\n* `abstract_all_tokens`: Which mode do you train your model for supporting fact extraction, if you generate all the tokens, add this argument (Rougel-L).\n* `evaluate_answer`: Whether you want to evaluate the answer synthesis task (Rougel-L).\n* `beam_size`: Setting beam size to 1 would significantly accelerate inference, but hurt the performance a little bit.\n\n\n## Run WebCPM for New Questions\n\nThis is the implementation for the whole pipeline evaluation. You can use the following codes to generate answers for new questions. Note this requires you to first get a Bing search API key from [here](https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fbing\u002Fapis\u002Fbing-web-search-api) and run the following codes:\n\n```bash\ncd run_web_browsing\nexport PYTHONPATH=\u002F**base-path**\u002Fwebcpm\nexport BING_SEARCH_KEY=\"**Your Bing Search API Key**\"\n```\n\n### Interactive Web Search\n\n```bash\npython run_interactive.py --data_path predictions\u002Ftest_interactive.json --ckpt_path **your-checkpoint**\n```\n\n### Pipeline-based Web Search\n\n```bash\npython run_pipeline.py --data_path predictions\u002Ftest.json --ckpt_path **your-checkpoint**\n```\n\nWe explain some of the arguments as follows:\n\n* `data_path`: The path you write your predictions.\n* `ckpt_path`: The path to the checkpoint where you have trained using the pipeline-based method.\n\n\n## Platform Building for Data Annotation\n\n![platform](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthunlp_WebCPM_readme_bfb171354572.png)\n\nWe open source our web search interface, you can use it for data annotation. Please refer to [Annotation](.\u002Fannotation_platform\u002FREADME.md). The codes are a bit messy currently, we will soon upload a cleaner version.\n\n\n## Bugs or questions?\n\nIf you have any questions related to the codes or the paper, please contact Yujia (`qyj20@mails.tsinghua.edu.cn`) or open an issue.\n\n## Resources of Tool Learning\n\nWith the powerful capabilities of foundation models, we are eager to see their applications in manipulating various tools. WebCPM is one typical research attempts. For more resources, please refer to the following:\n\n- **BMTools**. [[Project](https:\u002F\u002Fgithub.com\u002FOpenBMB\u002FBMTools)]\n\n- **Tool Learning**. [[Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2304.08354)]\n  \n- **Tool Learning Paper List**. [[Project](https:\u002F\u002Fgithub.com\u002Fthunlp\u002FToolLearningPapers)]\n\n## Citation\n\nIf you find our WebCPM useful, please use the following citation: \n\n```bibtex\n@inproceedings{qin2023webcpm,\n    title = \"WebCPM: Interactive Web Search for Chinese Long-form Question Answering\",\n    author={Yujia Qin and Zihan Cai and Dian Jin and Lan Yan and Shihao Liang and Kunlun Zhu and Yankai Lin and Xu Han and Ning Ding and Huadong Wang and Ruobing Xie and Fanchao Qi and Zhiyuan Liu and Maosong Sun and Jie Zhou},\n    booktitle = \"Proceedings of ACL 2023\",\n    year = \"2023\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https:\u002F\u002Farxiv.org\u002Fabs\u002F2305.06849\",\n}\n```\n","\u003Cdiv align=\"center\">\n\n\u003Ch1>WebCPM\u003C\u002Fh1>\n\n\u003C\u002Fdiv>\n\n✨ 这是 ACL 2023 论文 [面向中文长文档问答的交互式网络搜索](https:\u002F\u002Farxiv.org\u002Fabs\u002F2305.06849) 的实现。\n\n![paper](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthunlp_WebCPM_readme_760d526a75b4.png)\n\n*请阅读[中文版](README_zh.md)。*\n\n---\n\n\n## 快速链接\n\n- [快速链接](#quick-links)\n- [概述](#overview)\n- [要求](#requirements)\n- [准备](#preparation)\n  - [准备数据](#prepare-the-data)\n  - [准备模型](#prepare-the-model)\n- [训练 WebCPM](#train-webcpm)\n  - [基于流水线的网络搜索简介](#a-brief-introduction-of-pipeline-based-web-search)\n  - [数据预处理](#data-preprocessing)\n    - [交互式网络搜索的训练数据生成](#training-data-generation-of-interactive-web-search)\n    - [基于流水线的网络搜索的训练数据生成](#training-data-generation-of-pipeline-based-web-search)\n  - [训练](#training)\n- [单任务评估](#single-task-evaluation)\n- [为新问题运行 WebCPM](#run-webcpm-for-new-questions)\n  - [交互式网络搜索](#interactive-web-search)\n  - [基于流水线的网络搜索](#pipeline-based-web-search)\n- [用于数据标注的平台搭建](#platform-building-for-data-annotation)\n- [遇到 bug 或有疑问？](#bugs-or-questions)\n- [工具学习资源](#resources-of-tool-learning)\n- [引用](#citation)\n\n\n## 概述\n![platform](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthunlp_WebCPM_readme_eb6cb30d743c.png)\n\n在本工作中，我们提出了 WebCPM，这是一个使用中文预训练模型进行交互式网络搜索的项目。我们开发了一个网络搜索界面，该界面既能供人类使用，又能收集人类的网络搜索行为。随后，我们对参数规模高达 100 亿的预训练语言模型进行微调，以模仿人类的网络搜索行为，并根据收集到的事实生成答案。我们开源了网络搜索界面、数据集、实现代码以及模型参数。\n\n\n## 要求\n\n要运行我们的代码，请使用以下命令安装所有依赖包：\n\n```\npip install -r requirements.txt\n```\n\n**注意**：不同版本的软件包（例如 `pytorch`）可能会导致与论文中不同的结果。然而，无论您使用什么版本的软件包，总体趋势应该保持一致。\n\n## 准备\n\n### 准备数据\n\n首先从 [Google Drive](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F1IQBOCwhcMUnkxevv9wVFVLIFT3o8f7HX?usp=sharing) 下载数据，并将文件 `interactive_data` 和 `pipeline_data` 放入 `.\u002Fdata` 目录中，或者运行以下命令：\n\n下载的文件包含以下内容：\n\n`interactive_data\u002Fdata.json` 是论文实验中使用的数据集（共 **5500** 个实例）。\n`interactive_data\u002Fdata_zhihu.json` 是伴随本论文额外收集的数据集（约 **900** 个实例），问题来源于 [知乎](https:\u002F\u002Fwww.zhihu.com\u002Fpeople\u002F71-26-1-50)，可用于数据增强。\n\n请使用以下代码将上述数据拆分为训练集、验证集和测试集（设置 --add_zhihu 将添加 data_zhihu.json）。\n\n```bash\ncd data\u002Finteractive_data\npython split.py --add_zhihu\n```\n\n除了交互式网络搜索数据外，我们还提供了训练基于流水线的网络搜索所需的数据集：`pipeline_data`（共 **11 万个**实例）。所有数据均由 text-davinci-003 模型生成（也涉及必应搜索引擎），随后由人工标注员进行手动筛选。（**注意**这部分未包含在论文中，无需将其拆分为训练\u002F验证\u002F测试集。）\n\n\n### 准备模型\n\nWebCPM 基于 [CPM-bee](https:\u002F\u002Fgithub.com\u002FOpenBMB\u002FCPM-Live)，其参数规模最高可达 **100 亿**，是社区内最大的中文预训练语言模型之一。我们使用的是 CPM-bee 的早期版本，名为 cpm_10b_webcpm_exp.pt。最新版本的 CPM-bee 托管在 [New-CPM-bee](https:\u002F\u002Fgithub.com\u002FOpenBMB\u002FCPM-Bee) 中。您可能需要将 cpm-live 包替换为新版本。**请注意，该模型检查点尚未针对任何下游任务进行微调**。要获取 cpm_10b_webcpm_exp.pt，您可以从 [清华大学云](https:\u002F\u002Fcloud.tsinghua.edu.cn\u002Fd\u002Fa02ae00b11434c9c8560\u002F) 下载模型参数，或运行以下脚本：\n\n```\ncd models\nbash download_model_initial_model.sh\n```\n\n上述代码会将未经微调的 100 亿参数模型下载到 `models` 目录下。对于经过微调的流水线模型，请参考 `download_model_pipeline_finetuned.sh`，或直接从 [清华大学云](https:\u002F\u002Fcloud.tsinghua.edu.cn\u002Fd\u002F3dc39eccc6c64bb58671\u002F) 手动下载。\n\n## 训练 WebCPM\n\n![platform](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthunlp_WebCPM_readme_54f7e0430f46.png)\n\n我们提供了两个版本的 WebCPM：(1) 交互式网络搜索（ACL 论文提出的方法）和 (2) 基于流水线的网络搜索，后者更易于部署（该方法未在论文中报道）。这两个版本分别使用不同的脚本生成训练数据，但采用相同的代码进行模型训练。\n\n### 基于流水线的网络搜索简介\n\n其工作流程分为四个阶段：(1) 首先根据原始问题生成可能的搜索查询；(2) 然后针对每个搜索查询调用必应搜索引擎并访问前 K 个网页；(3) 对每个网页提取重要信息；(4) 根据所有记录的信息生成连贯而细致的答案。所有这些步骤均以多任务方式训练，详情请参阅 `run_web_browsing\u002Frun_pipeline.py`。有关交互式网络搜索的详细信息，请参阅我们的原始论文。\n\n### 数据预处理\n\n在开始之前，请运行以下命令：\n\n```bash\nexport PYTHONPATH=\u002F**your-base-path**\u002Fwebcpm\n```\n\n训练数据的生成分为交互式网络搜索和基于流水线的方法。以下代码将在相应文件夹中生成 `train_data`、`dev_data` 和 `test_data`，这些数据将在训练过程中被加载。\n\n#### 交互式网络搜索的训练数据生成\n\n首先，使用以下命令构建合成模型的数据：\n\n```bash\ncd dataset_interactive\npython make_data_synthesis_model.py --data_path ..\u002F..\u002Fdata\u002Finteractive_data  --augment_qa_data --augment_data_path ..\u002F..\u002Fdata\u002Fpipeline_data\n```\n\n其中一些参数说明如下：\n\n* `data_path`: 数据源路径。\n* `augment_qa_data`: 是否使用 text-davinci 自动生成的问答数据来增强训练数据。（若要复现论文中的结果，请不要添加此参数）\n* `augment_data_path`: 增强训练数据的路径。\n\n接下来是搜索模型的训练数据生成：\n\n```bash\npython make_data_search_model.py --add_query --add_action --add_abstract --abstract_all_tokens\n```\n\n其中一些参数说明如下：\n\n* `data_path`: 数据源路径。\n* `add_query`: 如果为 True，则会添加查询生成数据。\n* `add_abstract`: 如果为 True，则会添加支持性事实抽取数据。\n* `abstract_all_tokens`: 如果为 True，支持性事实抽取模块将生成所有 token，而不仅仅是前几个或后几个 token。\n* `add_action`: 如果为 True，则会添加动作预测数据。\n* `add_synthesis`: 如果为 True，则会加载合成模型的本地数据。**请注意，必须先运行 `python make_data_synthesis_model.py` 获取合成数据，然后再在此处添加该参数**。\n\n如果希望以多任务方式训练所有子任务，只需添加上述所有参数；否则，仅添加一个参数（例如 `--add_query`）即可进行单任务测试。\n\n#### 基于流水线的网络搜索的训练数据生成\n\n请运行以下命令：\n\n```bash\ncd dataset_pipeline\npython make_data.py\n```\n\n### 训练\n\n要训练 WebCPM，请运行以下命令：\n\n```bash\ncd training\nexport PYTHONPATH=\u002F**your-base-path**\u002Fwebcpm\nexport CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7\nGPUS_PER_NODE=$(echo $CUDA_VISIBLE_DEVICES | tr ',' '\\n' | wc -l | xargs)\necho \"可见设备数量: $GPUS_PER_NODE，应与实际可见设备数量一致\"\n\nset -ex\n\nMASTER_ADDR=localhost\nMASTER_PORT=3239\nNNODES=1\nNODE_RANK=0\n\nOPTS=\"\"\nOPTS+=\" --model-config config\u002Fcpm-bee-10b.json\"\nOPTS+=\" --dataset ..\u002Fdata\u002Fdataset_interactive\u002Ftrain_data\"\nOPTS+=\" --dataseteval ..\u002Fdata\u002Fdataset_interactive\u002Fdev_data\"\nOPTS+=\" --epoch 5\"\nOPTS+=\" --batch-size 8\"\nOPTS+=\" --train-iters 100\"\nOPTS+=\" --save-name webcpm_finetuned\"\nOPTS+=\" --max-length 2560\"\nOPTS+=\" --save ..\u002Fmodels\u002F\"\nOPTS+=\" --lr 0.0001\"\nOPTS+=\" --inspect-iters 100\"\nOPTS+=\" --warmup-iters 1\"\nOPTS+=\" --save-epochs 1\"\nOPTS+=\" --lr-decay-style noam\"\nOPTS+=\" --weight-decay 0.01\"\nOPTS+=\" --clip-grad 1.0\"\nOPTS+=\" --loss-scale 32768\"\nOPTS+=\" --start-step 0\"\nOPTS+=\" --load ..\u002Fmodels\u002Fcpm_10b_webcpm_exp.pt\"\n\nCMD=\"torchrun --nnodes=${NNODES} --nproc_per_node=${GPUS_PER_NODE} --rdzv_id=1 --rdzv_backend=c10d --rdzv_endpoint=${MASTER_ADDR}:${MASTER_PORT} finetune_cpm_bee.py ${OPTS}\"\n\necho ${CMD}\n$CMD\n```\n\n其中一些参数说明如下：\n\n* `dataset` 和 `dataseteval`: 处理后的文件路径。对于交互式网络搜索，路径为 `dataset_interactive`；对于基于流水线的方法，路径为 `dataset_pipeline`。\n* `batch-size`: 单个 GPU 的批次大小，实际批次大小为 GPU 数量 × 每个 GPU 的批次大小。\n* `max-length`: 数据的最大序列长度（不是模型的最大序列长度），超过此长度的训练样本将会被丢弃。\n* `save-name` 和 `save`: 微调后模型的保存路径及模型检查点的名称。\n* `epoch`: 训练的轮数。\n* `load`: 预训练模型检查点的路径（本例中为 cpmb）。\n\n请注意，无论您训练的是哪个模块（或多任务设置），都可以使用上述代码。我们是在 8 张 80G A100 上进行训练的，您可以根据自己的 GPU 设备调整批次大小，性能对超参数并不敏感。\n\n## 单任务评估\n\n要评估不同的子任务，您可以先运行以下命令，获取微调后模型在测试数据上的预测结果：\n\n```bash\ncd inference\npython inference.py --test_file ..\u002Ftraining\u002Fdataset_interactive\u002Ftest.txt --output_file output\u002Ftest_predictions.json --ckpt_path **your_finetuned_checkpoint.pt\n```\n\n其中一些参数说明如下：\n\n* `test_file`: 测试文件路径，应在数据预处理阶段生成。\n* `output_file`: 您希望写入预测结果的路径。\n* `ckpt_path`: 您微调后模型的路径。\n\n获得测试文件的预测结果后，您可以运行以下代码进行单任务评估：\n\n```bash\npython evaluate.py --input_file output\u002Ftest_predictions.txt --evaluate_action\n```\n\n其中一些参数说明如下：\n\n* `input_file`: 您写入测试文件预测结果的路径。\n* `evaluate_action`: 是否要评估动作预测任务（F1）。\n* `evaluate_query`: 是否要评估搜索查询生成任务（Rougel-L）。\n* `evaluate_abstract`: 是否要评估支持性事实抽取任务（Rougel-L）。\n* `abstract_all_tokens`: 您的模型在支持性事实抽取方面采用哪种模式，如果您生成所有 token，请添加此参数（Rougel-L）。\n* `evaluate_answer`: 是否要评估答案合成任务（Rougel-L）。\n* `beam_size`: 将束宽设置为 1 可显著加快推理速度，但可能会略微降低性能。\n\n\n## 使用 WebCPM 回答新问题\n\n这是整个流水线评估的实现。您可以使用以下代码为新问题生成答案。请注意，这需要您首先从 [这里](https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fbing\u002Fapis\u002Fbing-web-search-api) 获取 Bing 搜索 API 密钥，并运行以下命令：\n\n```bash\ncd run_web_browsing\nexport PYTHONPATH=\u002F**base-path**\u002Fwebcpm\nexport BING_SEARCH_KEY=\"**Your Bing Search API Key**\"\n```\n\n### 交互式网络搜索\n\n```bash\npython run_interactive.py --data_path predictions\u002Ftest_interactive.json --ckpt_path **your-checkpoint**\n```\n\n### 基于流水线的网络搜索\n\n```bash\npython run_pipeline.py --data_path predictions\u002Ftest.json --ckpt_path **your-checkpoint**\n```\n\n其中一些参数说明如下：\n\n* `data_path`: 您写入预测结果的路径。\n* `ckpt_path`: 您使用基于流水线的方法进行训练的检查点路径。\n\n## 数据标注平台搭建\n\n![platform](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthunlp_WebCPM_readme_bfb171354572.png)\n\n我们开源了我们的网页搜索界面，您可以将其用于数据标注。请参阅[标注](.\u002Fannotation_platform\u002FREADME.md)。目前代码尚显杂乱，我们很快会上传一个更整洁的版本。\n\n\n## 发现问题或有疑问？\n\n如果您对代码或论文有任何疑问，请联系Yujia（`qyj20@mails.tsinghua.edu.cn`）或提交一个问题。\n\n## 工具学习相关资源\n\n借助基础模型的强大能力，我们非常期待它们在操作各类工具方面的应用。WebCPM便是其中一项典型的研究尝试。更多资源请参阅以下内容：\n\n- **BMTools**。[[项目](https:\u002F\u002Fgithub.com\u002FOpenBMB\u002FBMTools)]\n\n- **工具学习**。[[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2304.08354)]\n  \n- **工具学习论文列表**。[[项目](https:\u002F\u002Fgithub.com\u002Fthunlp\u002FToolLearningPapers)]\n\n## 引用\n\n如果您认为我们的WebCPM很有用，请使用以下引用：\n\n```bibtex\n@inproceedings{qin2023webcpm,\n    title = \"WebCPM: 用于中文长文本问答的交互式网络搜索\",\n    author={秦宇佳、蔡子涵、金典、闫兰、梁世豪、朱坤伦、林彦凯、韩旭、丁宁、王华东、谢若冰、齐凡超、刘知远、孙茂松、周杰},\n    booktitle = \"ACL 2023会议论文集\",\n    year = \"2023\",\n    publisher = \"计算语言学协会\",\n    url = \"https:\u002F\u002Farxiv.org\u002Fabs\u002F2305.06849\",\n}\n```","# WebCPM 快速上手指南\n\nWebCPM 是一个基于中文预训练模型（CPM-bee）的交互式网页搜索项目，旨在模仿人类行为进行长文本问答。本项目开源了搜索接口、数据集、实现代码及模型参数。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**: Linux (推荐)\n- **Python**: 3.8+\n- **GPU**: 建议多卡环境（原文使用 8x80G A100），单卡需调整 batch size\n- **依赖库**: PyTorch, CPM-Live 等\n\n### 前置依赖\n在开始之前，请确保已安装基础依赖。\n\n```bash\npip install -r requirements.txt\n```\n\n> **注意**：不同版本的依赖包（如 `pytorch`）可能导致结果与论文略有差异，但整体趋势一致。\n\n## 安装步骤\n\n### 1. 数据准备\n下载数据集并放置到 `.\u002Fdata` 目录，或使用脚本自动下载。数据集包含交互式搜索数据（5500 条）和流水线式搜索数据（11 万条）。\n\n**手动下载**:\n从 [Google Drive](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F1IQBOCwhcMUnkxevv9wVFVLIFT3o8f7HX?usp=sharing) 下载 `interactive_data` 和 `pipeline_data` 文件夹。\n\n**划分数据集**:\n```bash\ncd data\u002Finteractive_data\npython split.py --add_zhihu\n```\n*注：`--add_zhihu` 参数会将额外的知乎数据加入训练集以增强数据。*\n\n### 2. 模型准备\nWebCPM 基于 **10B 参数**的 CPM-bee 模型。你需要下载初始预训练权重（未微调）或已微调的流水线模型权重。\n\n**下载初始模型 (cpm_10b_webcpm_exp.pt)**:\n```bash\ncd models\nbash download_model_initial_model.sh\n```\n*备选方案*: 若脚本下载失败，可手动从 [清华云盘](https:\u002F\u002Fcloud.tsinghua.edu.cn\u002Fd\u002Fa02ae00b11434c9c8560\u002F) 下载。\n\n**下载已微调的流水线模型 (可选)**:\n```bash\nbash download_model_pipeline_finetuned.sh\n```\n*备选方案*: 手动从 [清华云盘](https:\u002F\u002Fcloud.tsinghua.edu.cn\u002Fd\u002F3dc39eccc6c64bb58671\u002F) 下载。\n\n## 基本使用\n\n本部分展示如何运行 WebCPM 对新问题进行回答。使用前需配置环境变量并获取 Bing 搜索 API Key。\n\n### 1. 配置环境与 API\n获取 [Bing Web Search API Key](https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Fbing\u002Fapis\u002Fbing-web-search-api)，然后设置环境变量：\n\n```bash\ncd run_web_browsing\nexport PYTHONPATH=\u002F**your-base-path**\u002Fwebcpm\nexport BING_SEARCH_KEY=\"**Your Bing Search API Key**\"\n```\n*(请将 `\u002F**your-base-path**` 替换为你的项目根目录路径)*\n\n### 2. 运行交互式搜索 (Interactive Web Search)\n这是论文中提出的主要方法，模拟人类逐步搜索的行为。\n\n```bash\npython run_interactive.py --data_path predictions\u002Ftest_interactive.json --ckpt_path **your-checkpoint**\n```\n*   `--data_path`: 输入问题文件的路径。\n*   `--ckpt_path`: 你微调后的模型检查点路径（或初始模型路径）。\n\n### 3. 运行流水线式搜索 (Pipeline-based Web Search)\n此版本更易于部署，流程为：生成查询 -> 搜索 -> 提取信息 -> 生成答案。\n\n```bash\npython run_pipeline.py --data_path predictions\u002Ftest.json --ckpt_path **your-checkpoint**\n```\n\n### 4. (可选) 微调训练\n如果你希望用自己的数据训练模型，可以使用以下命令启动训练（以交互式搜索为例）：\n\n```bash\ncd training\nexport PYTHONPATH=\u002F**your-base-path**\u002Fwebcpm\nexport CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7\n\n# 设置分布式训练参数\nGPUS_PER_NODE=$(echo $CUDA_VISIBLE_DEVICES | tr ',' '\\n' | wc -l | xargs)\nMASTER_ADDR=localhost\nMASTER_PORT=3239\n\nOPTS=\"\"\nOPTS+=\" --model-config config\u002Fcpm-bee-10b.json\"\nOPTS+=\" --dataset ..\u002Fdata\u002Fdataset_interactive\u002Ftrain_data\"\nOPTS+=\" --dataseteval ..\u002Fdata\u002Fdataset_interactive\u002Fdev_data\"\nOPTS+=\" --epoch 5\"\nOPTS+=\" --batch-size 8\"\nOPTS+=\" --train-iters 100\"\nOPTS+=\" --save-name webcpm_finetuned\"\nOPTS+=\" --max-length 2560\"\nOPTS+=\" --save ..\u002Fmodels\u002F\"\nOPTS+=\" --lr 0.0001\"\nOPTS+=\" --load ..\u002Fmodels\u002Fcpm_10b_webcpm_exp.pt\"\n\nCMD=\"torchrun --nnodes=1 --nproc_per_node=${GPUS_PER_NODE} --rdzv_id=1 --rdzv_backend=c10d --rdzv_endpoint=${MASTER_ADDR}:${MASTER_PORT} finetune_cpm_bee.py ${OPTS}\"\n\n$CMD\n```\n*注意：请根据你的显存大小调整 `--batch-size` 参数。*","某智库研究员需要针对“中国新能源汽车产业链在 2023 年的关键瓶颈与突破”这一复杂议题，撰写一份深度分析报告。\n\n### 没有 WebCPM 时\n- **信息检索碎片化**：研究员需手动在多个搜索引擎中反复切换关键词，难以系统性地获取覆盖全产业链的最新数据。\n- **长文生成逻辑断层**：收集到的资料零散，人工整合成连贯的长篇报告耗时极长，且容易遗漏关键因果链条。\n- **中文语境理解偏差**：通用模型对国内特有的政策术语（如“双积分政策”）或社区讨论（如知乎深度帖）理解不足，导致内容空洞。\n- **事实核查成本高**：生成的内容缺乏实时网页依据，研究员必须逐条回溯验证信息来源，效率极低。\n\n### 使用 WebCPM 后\n- **交互式自主搜索**：WebCPM 能模拟人类专家行为，自主规划搜索路径，主动挖掘从政策解读到企业动态的多维度信息。\n- **基于事实的长文生成**：模型直接基于检索到的实时网页事实，自动生成逻辑严密、引据详实的千字以上深度分析。\n- **深耕中文垂直领域**：依托 CPM-bee 基座及知乎等高质量中文数据微调，精准把握本土行业术语与社区观点，内容更具洞察力。\n- **来源可追溯**：生成的每一段论述均自动关联原始网页链接，研究员可直接点击核验，大幅降低事实核查的时间成本。\n\nWebCPM 将研究员从繁琐的“搜索 - 整理 - 写作”循环中解放出来，使其能专注于高价值的策略判断，实现了中文长问答领域的效率跃迁。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthunlp_WebCPM_eb6cb30d.png","thunlp","THUNLP","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fthunlp_13da7b2e.png","Natural Language Processing Lab at Tsinghua University",null,"thunlp@gmail.com","http:\u002F\u002Fnlp.csai.tsinghua.edu.cn","https:\u002F\u002Fgithub.com\u002Fthunlp",[84,88,92,96,100,104,108],{"name":85,"color":86,"percentage":87},"HTML","#e34c26",71.8,{"name":89,"color":90,"percentage":91},"Python","#3572A5",24.2,{"name":93,"color":94,"percentage":95},"TypeScript","#3178c6",1.9,{"name":97,"color":98,"percentage":99},"JavaScript","#f1e05a",1.3,{"name":101,"color":102,"percentage":103},"Vue","#41b883",0.5,{"name":105,"color":106,"percentage":107},"Shell","#89e051",0.2,{"name":109,"color":110,"percentage":111},"Less","#1d365d",0.1,914,72,"2026-03-26T11:38:44","Apache-2.0",4,"未说明","必需，官方示例使用 8x80G A100 GPU，模型参数量达 10B，建议显存充足以支持大模型微调",{"notes":120,"python":117,"dependencies":121},"需安装 requirements.txt 中的依赖；不同版本的 PyTorch 等包可能导致结果与论文有差异；需自行申请 Bing Search API Key；初始模型约 10B 参数，需从清华云盘下载；支持交互式搜索和流水线式搜索两种模式。",[122,123],"torch","cpm-live (或适配新版 CPM-Bee 的包)",[26,15],"2026-03-27T02:49:30.150509","2026-04-06T08:10:32.060936",[128,133,138,143,148,153,158,163],{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},10848,"运行代码时遇到 KeyError: 'MASTER_PORT' 错误，缺少分布式环境变量怎么办？","这通常是因为没有正确启动分布式训练环境。该变量（以及 WORLD_SIZE, RANK 等）应由分布式启动脚本自动设置，无需手动安装特有库。请确保使用正确的分布式启动命令（如 bmtrain 或 torchrun 相关命令）来运行 finetune_cpm_bee.py，而不是直接通过 python 脚本运行。","https:\u002F\u002Fgithub.com\u002Fthunlp\u002FWebCPM\u002Fissues\u002F12",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},10849,"WebCPM 的预训练模型是否开源？单张 RTX 4090 显卡可以运行吗？","基于 Pipeline 方式的微调模型已经开源，可以通过项目 README 中的 download_model_pipeline_finetuned.sh 脚本下载，或从清华大学云盘手动下载。基于 Interactive Web Search 的模型也计划开源。关于显存，Pipeline 模型在单张 4090 上通常可以运行进行推理，但具体取决于上下文长度和批量大小。","https:\u002F\u002Fgithub.com\u002Fthunlp\u002FWebCPM\u002Fissues\u002F21",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},10850,"训练过程中服务器内存（RAM）爆炸导致报错，如何解决？","如果使用的是 bmt.optim.AdamOffloadOptimizer 导致 CPU 内存不足，可以尝试改用 bmt.optim.AdamOptimizer。注意，切换到 AdamOptimizer 会减少 CPU 内存占用，但会增加 GPU 显存的占用。请根据服务器配置（如 256G 内存）权衡选择。","https:\u002F\u002Fgithub.com\u002Fthunlp\u002FWebCPM\u002Fissues\u002F9",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},10851,"运行流水线搜索（run_pipeline.py）时报错 KeyError: 'webPages' 是什么原因？","这是因为 Bing 搜索 API 在某些情况下（如被误判为攻击、无相关新闻结果或订阅密钥权限问题）虽然返回 HTTP 200 状态码，但响应体中可能不包含 'webPages' 字段。解决方案是在代码中增加判断逻辑，检查 'webPages' 键是否存在后再访问，避免直接取值导致崩溃。维护者已提交修复版本。","https:\u002F\u002Fgithub.com\u002Fthunlp\u002FWebCPM\u002Fissues\u002F18",{"id":149,"question_zh":150,"answer_zh":151,"source_url":152},10852,"Interactive 模式下为什么在数据处理时去掉了引用（cite）信息？","虽然数据收集阶段保留了引用信息，但在当前的模型训练流程中并未实际使用这部分数据，因此在 make_data_synthesis_model.py 中被移除。团队期待在未来的工作中利用这些信息来实现更完善的长文本问答功能。","https:\u002F\u002Fgithub.com\u002Fthunlp\u002FWebCPM\u002Fissues\u002F24",{"id":154,"question_zh":155,"answer_zh":156,"source_url":157},10853,"make_data_synthesis_model.py 中 rouge 评分计算在 Python 3 下是否有兼容性问题？","是的，原代码中使用 ans.split() 处理字符串在某些 Python 3 环境下可能不符合预期。建议将代码修改为使用 list(ans) 或其他明确的字符分割方式，以确保 rouge 评分计算正确。该问题已被确认并修复。","https:\u002F\u002Fgithub.com\u002Fthunlp\u002FWebCPM\u002Fissues\u002F23",{"id":159,"question_zh":160,"answer_zh":161,"source_url":162},10854,"WebCPM 的 Pipeline 模式和 Interactive 模式在架构上有什么区别？","Pipeline 模式是一个整体模型，具备直接使用搜索引擎的能力，参考 run_web_browsing\u002Frun_pipeline.py 运行。而 Interactive 模式在论文实验中涉及检索模型和合成模型的协同（或分阶段训练），旨在模仿人类搜索行为。目前开源的主要是 Pipeline 模式的微调模型。","https:\u002F\u002Fgithub.com\u002Fthunlp\u002FWebCPM\u002Fissues\u002F14",{"id":164,"question_zh":165,"answer_zh":166,"source_url":167},10855,"模型是否有必要模仿人类的搜索行为（如翻页、筛选）？更换搜索引擎会影响模型效果吗？","1. 模仿人类行为不是必须的，但是一条可行且方便的路径。机器理论上可以以更高效的方式（如阅读更多页面）交互，但这需要新的研究探索。2. 更换搜索引擎对模型性能影响不大。不同搜索引擎返回的结果大同小异，迁移成本较低，直接接入其他搜索引擎通常不会导致效果大幅变化。","https:\u002F\u002Fgithub.com\u002Fthunlp\u002FWebCPM\u002Fissues\u002F20",[]]