euiyulsong
commited on
Commit
•
88aa26d
1
Parent(s):
ee49afd
Update README.md
Browse files
README.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1 |
-
|
2 |
-
|
|
|
|
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
config = AutoConfig.from_pretrained("t5-base")
|
5 |
|
6 |
tokenizer = T5Tokenizer.from_pretrained("t5-base")
|
|
|
1 |
+
<pre><code><span style="color:#03A9F4">from</span> transformers <span style="color:#03A9F4">import</span> AutoConfig, T5Tokenizer,
|
2 |
+
generator = pipeline(<span style="color:#FF9800">'text-generation'</span>,
|
3 |
+
model=<span style="color:#FF9800">'huggingtweets/fidelity'</span>)
|
4 |
+
generator(<span style="color:#FF9800">"My dream is"</span>, num_return_sequences=<span style="color:#8BC34A">5</span>)</code></pre>
|
5 |
|
6 |
+
<pre><code><span style="color:#03A9F4">from</span> fid <span style="color:#03A9F4">import</span> FiDT5
|
7 |
+
|
8 |
+
question = <span style="color:#FF9800">"question:"</span>
|
9 |
+
title = <span style="color:#FF9800">"title:"</span>
|
10 |
+
context = <span style="color:#FF9800">"context:"</span>
|
11 |
+
tokenizer.add_tokens([question, title, context], special_tokens=True)
|
12 |
+
tokenizer._question = question
|
13 |
+
tokenizer._title = title
|
14 |
+
tokenizer._context = context
|
15 |
config = AutoConfig.from_pretrained("t5-base")
|
16 |
|
17 |
tokenizer = T5Tokenizer.from_pretrained("t5-base")
|