YAML Metadata
Warning:
empty or missing yaml metadata in repo card
(https://huggingface.co/docs/hub/model-cards#model-card-metadata)
Hunyuan-MT-7B-MNN
這是 Tencent/Hunyuan-MT-7B 的 MNN 格式版本,針對移動端和桌面端推理優化。
模型信息
- 原始模型: Tencent/Hunyuan-MT-7B
- 框架: MNN (Mobile Neural Network)
- 量化: 4-bit 量化
- 模型大小: ~4.6 GB (相比原始 FP16 模型顯著減小)
- 轉換日期: 2025-11-30
文件說明
llm.mnn: MNN 模型結構文件 (~510 KB)llm.mnn.weight: 量化後的模型權重 (~4.6 GB)llm.mnn.json: 模型結構的 JSON 表示 (~1.0 MB)tokenizer.txt: 分詞器文件 (~1.3 MB)config.json: 模型配置文件llm_config.json: LLM 特定配置export_args.json: 導出參數記錄model_info.json: 模型元信息
使用方法
1. 使用 MNN C++ API
#include <MNN/expr/Executor.hpp>
#include <MNN/AutoTime.hpp>
#include "llm/llm.hpp"
// 創建 LLM 實例
std::unique_ptr<Llm> llm(Llm::createLLM(config));
// 加載模型
llm->load("path/to/llm.mnn");
// 生成文本
auto response = llm->response("翻譯這段文字");
2. 在 iOS/macOS 應用中使用
import MNN
// 配置 MNN 後端
let config = MNNLLMConfig()
config.backend = .metal // 使用 Metal GPU 加速
// 創建 LLM wrapper
let wrapper = MNNLLMWrapper(backendType: .metal)
// 加載模型
wrapper.loadModel(
atPath: modelPath,
modelType: "llm"
) { success, error in
if success {
// 生成翻譯
let result = wrapper.generateResponse(
forPrompt: sourceText,
useChatTemplate: true
)
}
}
性能特點
- 量化優勢: 4-bit 量化將模型大小從 ~14GB 減少到 ~4.6GB
- 推理速度: 在 Apple Silicon (M1/M2/M3) 上利用 Metal 加速
- 內存占用: 較原始模型顯著降低
- 精度損失: 4-bit 量化保持了良好的翻譯質量
系統要求
- macOS: 10.15+ (推薦 12.0+ 以支持 Metal 3)
- iOS: 13.0+
- 架構: arm64 (Apple Silicon 或 iOS 設備)
- 內存: 至少 8GB RAM 推薦
轉換命令
此模型使用以下命令轉換:
python llmexport.py \
--path Tencent/Hunyuan-MT-7B \
--export mnn \
--quant_bit 4 \
--dst_path ./hunyuan-mt-7b-mnn
License
本模型繼承自原始 Tencent/Hunyuan-MT-7B 的許可協議。請參閱原始模型倉庫了解詳細許可信息。
引用
如果您使用此模型,請引用原始 Hunyuan-MT 模型:
@misc{hunyuan-mt-7b,
title={Hunyuan-MT-7B: A Multilingual Translation Model},
author={Tencent AI Lab},
year={2024},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/Tencent/Hunyuan-MT-7B}}
}
相關資源
問題反饋
如有問題或建議,請在此倉庫提交 Issue。
- Downloads last month
- 16
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support