File size: 1,365 Bytes
048b51a
4b2114d
 
 
 
 
 
 
 
 
 
7393c1e
4b2114d
048b51a
 
4b2114d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
language:
- en
- fr
- ro
- de
datasets:
- c4
tags:
- summarization
- translation
- openvino

license: apache-2.0
---

## [t5-small](https://huggingface.co/t5-small) exported to the OpenVINO IR.

## Model description

[T5](https://huggingface.co/docs/transformers/model_doc/t5#t5) is an encoder-decoder model pre-trained on a multi-task mixture of unsupervised and supervised tasks and for which each task is converted into a text-to-text format.

For more information, please take a look at the original paper.

Paper: [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://arxiv.org/pdf/1910.10683.pdf)

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


## Usage example

You can use this model with Transformers *pipeline*.

```python
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)
```