echarlaix HF staff commited on
Commit
4b2114d
1 Parent(s): e6a424c

Add usage example

Browse files
Files changed (1) hide show
  1. README.md +43 -0
README.md CHANGED
@@ -1,3 +1,46 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ - fr
5
+ - ro
6
+ - de
7
+ datasets:
8
+ - c4
9
+ tags:
10
+ - summarization
11
+ - translation
12
+
13
  license: apache-2.0
14
  ---
15
+
16
+ ## [t5-small](https://huggingface.co/t5-small) exported to the OpenVINO IR.
17
+
18
+ ## Model description
19
+
20
+ [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.
21
+
22
+ For more information, please take a look at the original paper.
23
+
24
+ Paper: [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://arxiv.org/pdf/1910.10683.pdf)
25
+
26
+ Authors: *Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu*
27
+
28
+
29
+ ## Usage example
30
+
31
+ You can use this model with Transformers *pipeline*.
32
+
33
+ ```python
34
+ from transformers import AutoTokenizer, pipeline
35
+ from optimum.intel.openvino import OVModelForSeq2SeqLM
36
+
37
+ model_id = "echarlaix/t5-small-openvino"
38
+ model = OVModelForSeq2SeqLM.from_pretrained(model_id, use_cache=False)
39
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
40
+
41
+ # Create a pipeline
42
+ translation_pipe = pipeline("translation_en_to_fr", model=model, tokenizer=tokenizer)
43
+
44
+ text = "He never went out without a book under his arm, and he often came back with two."
45
+ result = translation_pipe(text)
46
+ ```