英文

t5-small

模型描述

T5 是一个编码器-解码器模型,它在多个无监督和有监督任务的混合数据上进行预训练,并且每个任务都被转换为文本到文本的格式。

更多信息,请参阅原始论文。

论文: Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer

作者:Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu

使用示例

您可以将此模型与Transformers pipeline一起使用。

from transformers import AutoTokenizer, pipeline
from optimum.intel.openvino import OVModelForSeq2SeqLM

model_id = "echarlaix/t5-small-openvino"
model = OVModelForSeq2SeqLM.from_pretrained(model_id, use_cache=False)
tokenizer = AutoTokenizer.from_pretrained(model_id)

# Create a pipeline
translation_pipe = pipeline("translation_en_to_fr", model=model, tokenizer=tokenizer)

text = "He never went out without a book under his arm, and he often came back with two."
result = translation_pipe(text)