Variable65536/minicpm5-1b-immersive-translate-gguf
0198
MiniCPM5-1B Immersive Translate (GGUF)
英译中专用翻译模型的 GGUF 量化版本,基于 `MiniCPM5-1B-Base` 微调,面向 沉浸式翻译 插件场景优化。使用 llama.cpp 转换并量化。
模型概览
文件清单
快速开始
llama.cpp
# 下载模型
huggingface-cli download Variable65536/minicpm5-1b-immersive-translate-gguf \
minicpm5-immersive-imatrix-Q4_K_M.gguf --local-dir ./minicpm5-immersive
# 交互式聊天(自动应用 chat template)
llama-cli -m ./minicpm5-immersive/minicpm5-immersive-translate-imatrix-Q4_K_M.gguf \
-n 2048 --temp 0.2 --top-p 0.9 -ngl 99
# 启动 OpenAI 兼容 API 服务
llama-server -m ./minicpm5-immersive/minicpm5-immersive-translate-imatrix-Q4_K_M.gguf \
--port 8000 --host 0.0.0.0 -ngl 99 -c 4096Ollama
# 从 Hugging Face 直接拉取(需 Ollama 支持 GGUF 仓库)
ollama run hf.co/Variable65536/minicpm5-1b-immersive-translate-gguf:Q4_K_M如 Ollama 不支持直接拉取,先下载 GGUF 文件,再创建 Modelfile:
FROM ./minicpm5-immersive-translate-imatrix-Q4_K_M.gguf
PARAMETER temperature 0.2
PARAMETER top_p 0.9
PARAMETER num_predict 512ollama create minicpm5-immersive -f Modelfile
ollama run minicpm5-immersiveLM Studio
直接在 LM Studio 中搜索 Variable65536/minicpm5-1b-immersive-translate-gguf,或下载 GGUF 文件后手动导入。
提示词格式
本模型训练时使用与沉浸式翻译插件完全对齐的 system prompt 和 user prompt 格式。推理时必须使用相同格式,否则输出质量会下降。
System Prompt
You are a professional Chinese native translator who needs to fluently translate text into Chinese.
## Translation Rules
1. Output only the translated content, without explanations or additional content (such as "Here's the translation:" or "Translation as follows:")
2. The returned translation must maintain exactly the same number of paragraphs and format as the original text
3. If the text contains HTML tags, consider where the tags should be placed in the translation while maintaining fluency
4. For content that should not be translated (such as proper nouns, code, etc.), keep the original text.
5. If input contains %%, use %% in your output, if input has no %%, don't use %% in your output
## OUTPUT FORMAT:
- **Single paragraph input** → Output translation directly (no separators, no extra text)
- **Multi-paragraph input** → Use %% as paragraph separator between translations单段输入
Translate to Chinese (output translation only):
{英文原文}多段输入(含 %% 分隔)
Translate to Chinese:
{英文段落 1}
%%
{英文段落 2}
%%
{英文段落 3}推荐推理参数
温度建议设在 0.1~0.3 之间,翻译任务不需要高随机性。
模型能力
训练数据覆盖以下场景,模型在这些任务上表现良好:
- 技术文档:GitHub README、Hugging Face 模型卡片、软件文档
- 学术摘要:arXiv 论文摘要英译中
- 格式保留:代码块(
`)、行内代码(`code`)、HTML 标签、URL、Markdown 标题 - 多段翻译:使用
%%分隔段落,输入输出段落数严格一致 - 专有名词:GitHub、Git、Microsoft 等保留原文不译
已知限制
- 纯代码块段落:当多段输入中存在仅含代码块的段落时,模型可能将其与相邻段落合并,导致
%%数量不一致。实际使用中插件通常会剥离代码块,影响较小。 - 维基百科信息框字段:如
Parent、Founded、Industry等字段的翻译可能不准确,训练数据未覆盖此类结构化字段。 - 复杂从句语序:个别
after、before等时间状语从句的语序可能出错。 - 合成数据风险:训练数据中 BiST 部分的中文译文为 LLM 合成,可能继承源模型的翻译偏好。
与沉浸式翻译插件配合使用
本模型设计为通过 OpenAI 兼容 API 接入沉浸式翻译插件:
- 用
llama-server启动本地服务(见「快速开始」) - 插件设置 → 翻译服务 → 选择 OpenAI 或 自定义 API
- 填入:
- API URL:
http://localhost:8000/v1/chat/completions - API Key:任意值(本地服务不校验)
- 模型:任意值(llama-server 忽略此字段)
- 保存后即可在插件中翻译网页
插件会自动发送其内置的 system prompt,与本模型训练时使用的格式一致。
引用
如果使用本模型,请同时引用原始数据源及 MiniCPM5:
@misc{minicpm5,
title={MiniCPM5},
author={OpenBMB},
year={2025},
howpublished={\url{https://huggingface.co/openbmb/MiniCPM5-1B}}
}致谢
- OpenBMB 提供 MiniCPM5-1B 基座模型
- llama.cpp 提供 GGUF 转换与推理工具
- LLaMA-Factory 提供微调框架
- 各源数据集作者与维护者
