返回模型
说明文档
ABEJA Qwen 2.5 7B 日语 - ONNX 模型
中文
模型概述
本仓库包含 ABEJA Qwen 2.5 7B 日语模型的 ONNX 模型,针对跨平台推理进行了优化。为了获得最佳性能,模型被分为预填充和令牌生成两个组件。
模型详情
- 基础模型: abeja/Qwen2.5-7B-Japanese
- 架构: Qwen2ForCausalLM
- 参数量: ~7.6B
- 语言: 日语(主要),英语(次要)
- 格式: ONNX
- 模型: 预填充 + 令牌生成
可用模型
1. 预填充模型
- 文件:
prefill/model.onnx - 用途: 用于初始提示处理的上下文预填充
- 大小: ~28.7MB
- 输入: 令牌序列
- 输出: 隐藏状态
2. 令牌生成模型
- 文件:
token_gen/model.onnx - 用途: 逐令牌生成
- 大小: ~28.7MB
- 输入: 隐藏状态
- 输出: 下一个令牌概率
系统要求
最低要求
- CPU: Intel i5-8400 / AMD Ryzen 5 2600 或更高
- 内存: 8GB 系统内存
- 存储: 2GB 可用空间
- 操作系统: Windows 10/11, macOS 10.15+, Ubuntu 18.04+
推荐配置
- CPU: Intel i7-10700K / AMD Ryzen 7 3700X 或更高
- 内存: 16GB 系统内存
- GPU: NVIDIA RTX 3060(8GB 显存)或更高
- 存储: 5GB 可用 SSD 空间
支持的设备
- 桌面端: Windows, macOS, Linux
- 云端: AWS, Google Cloud, Azure
- 边缘设备: NVIDIA Jetson Nano, Raspberry Pi 4 (8GB)
- 移动端: iOS, Android
- 嵌入式: ARM Cortex-A78, Intel Atom
使用方法
Python 与 ONNX Runtime
import onnxruntime as ort
import numpy as np
# 加载模型
prefill_session = ort.InferenceSession('prefill/model.onnx')
token_gen_session = ort.InferenceSession('token_gen/model.onnx')
# 推理示例
input_ids = np.array([[1, 2, 3, 4, 5]], dtype=np.int64)
prefill_outputs = prefill_session.run(None, {"input_ids": input_ids})
token_outputs = token_gen_session.run(None, {"hidden_states": prefill_outputs[0]})
C++ 与 ONNX Runtime
#include <onnxruntime_cxx_api.h>
Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "test");
Ort::Session session(env, "prefill/model.onnx", Ort::SessionOptions{{nullptr}});
// 运行推理
std::vector<int64_t> input_shape = {1, 5};
std::vector<int64_t> input_data = {1, 2, 3, 4, 5};
auto memory_info = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
Ort::Value input_tensor = Ort::Value::CreateTensor<int64_t>(
memory_info, input_data.data(), input_data.size(), input_shape.data(), input_shape.size());
安装
# CPU 版本
pip install onnxruntime
# GPU 版本(NVIDIA)
pip install onnxruntime-gpu
# 移动端部署
pip install onnxruntime-mobile
性能
- 跨平台: 支持任何 ONNX Runtime 平台
- 优化: 针对推理速度进行优化
- 内存高效: 比 PyTorch 内存占用更低
- 生产就绪: 适合生产环境部署
- 延迟: 预填充 <100ms,令牌生成 <50ms
日本語
モデル概要
このリポジトリには、クロスプラットフォーム推論用に最適化されたABEJA Qwen 2.5 7B日本語モデルのONNXモデルが含まれています。モデルは最適なパフォーマンスのためにプレフィルとトークン生成コンポーネントに分割されています。
モデル詳細
- ベースモデル: abeja/Qwen2.5-7B-Japanese
- アーキテクチャ: Qwen2ForCausalLM
- パラメータ数: ~7.6B
- 言語: 日本語(主要)、英語(副次)
- フォーマット: ONNX
- モデル: プレフィル + トークン生成
利用可能なモデル
1. プレフィルモデル
- ファイル:
prefill/model.onnx - 目的: 初期プロンプト処理のためのコンテキストプレフィル
- サイズ: ~28.7MB
- 入力: トークンシーケンス
- 出力: 隠れ状態
2. トークン生成モデル
- ファイル:
token_gen/model.onnx - 目的: トークンごとの生成
- サイズ: ~28.7MB
- 入力: 隠れ状態
- 出力: 次のトークン確率
システム要件
最小要件
- CPU: Intel i5-8400 / AMD Ryzen 5 2600以上
- RAM: 8GBシステムメモリ
- ストレージ: 2GB空き容量
- OS: Windows 10/11、macOS 10.15+、Ubuntu 18.04+
推奨要件
- CPU: Intel i7-10700K / AMD Ryzen 7 3700X以上
- RAM: 16GBシステムメモリ
- GPU: NVIDIA RTX 3060(8GB VRAM)以上
- ストレージ: 5GB空きSSD容量
対応デバイス
- デスクトップ: Windows、macOS、Linux
- クラウド: AWS、Google Cloud、Azure
- エッジ: NVIDIA Jetson Nano、Raspberry Pi 4(8GB)
- モバイル: iOS、Android
- 組み込み: ARM Cortex-A78、Intel Atom
使用方法
Python with ONNX Runtime
import onnxruntime as ort
import numpy as np
# モデルを読み込み
prefill_session = ort.InferenceSession('prefill/model.onnx')
token_gen_session = ort.InferenceSession('token_gen/model.onnx')
# 推論例
input_ids = np.array([[1, 2, 3, 4, 5]], dtype=np.int64)
prefill_outputs = prefill_session.run(None, {"input_ids": input_ids})
token_outputs = token_gen_session.run(None, {"hidden_states": prefill_outputs[0]})
インストール
# CPU版
pip install onnxruntime
# GPU版(NVIDIA)
pip install onnxruntime-gpu
# モバイルデプロイ用
pip install onnxruntime-mobile
パフォーマンス
- クロスプラットフォーム: ONNX Runtime対応プラットフォームで動作
- 最適化: 推論速度用に最適化
- メモリ効率: PyTorchより低いメモリ使用量
- 本番対応: 本番デプロイメントに適している
- レイテンシ: プレフィル<100ms、トークン生成<50ms
作者: Mukwaya Mark
marcusmi4n/abeja-qwen2.5-7b-japanese-onnx
作者 marcusmi4n
text-generation
onnx
↓ 0
♥ 0
创建时间: 2025-09-01 12:51:03+00:00
更新时间: 2025-09-01 13:57:23+00:00
在 Hugging Face 上查看文件 (5)
.gitattributes
README.md
model_info.json
prefill/model.onnx
ONNX
token_gen/model.onnx
ONNX