ONNX 模型库
返回模型

说明文档

T5 Base 艺术生成多指令 ONNX

这是 Mitchins/t5-base-artgen-multi-instruct 的 ONNX 版本,针对 CPU 推理进行了优化。

模型详情

  • 基础模型: T5-base (Google)
  • 训练样本: 297,282
  • 参数量: 222M
  • 格式: ONNX (FP32)
  • 优化: CPU 推理优化

四重指令能力

  1. 标准增强: Enhance this prompt: {text}
  2. 纯净增强: Enhance this prompt (no lora): {text}
  3. 技术增强: Enhance this prompt (with lora): {text}
  4. 简化: Simplify this prompt: {text}

使用方法

from optimum.onnxruntime import ORTModelForSeq2SeqLM
from transformers import T5Tokenizer

# 加载 ONNX 模型
model = ORTModelForSeq2SeqLM.from_pretrained("Mitchins/t5-base-artgen-multi-instruct-ONNX")
tokenizer = T5Tokenizer.from_pretrained("Mitchins/t5-base-artgen-multi-instruct-ONNX")

# 示例用法
text = "woman in red dress"
prompt = f"Enhance this prompt (no lora): {text}"

inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=80)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)

性能

针对 CPU 推理进行了优化,相比 CPU 上的 PyTorch 有显著加速。

Mitchins/t5-base-artgen-multi-instruct-ONNX

作者 Mitchins

text-generation optimum
↓ 1 ♥ 0

创建时间: 2025-09-03 10:52:18+00:00

更新时间: 2025-09-03 11:01:35+00:00

在 Hugging Face 上查看

文件 (10)

.gitattributes
README.md
added_tokens.json
config.json
decoder_model.onnx ONNX
encoder_model.onnx ONNX
generation_config.json
special_tokens_map.json
spiece.model
tokenizer_config.json