euiyulsong commited on
Commit
3f3e1c1
1 Parent(s): 88aa26d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -12
README.md CHANGED
@@ -1,18 +1,15 @@
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")
18
  ```
 
1
+ <pre><code><span style="color:#03A9F4">from</span> transformers <span style="color:#03A9F4">import</span> AutoConfig, T5Tokenizer
 
 
 
 
2
  <pre><code><span style="color:#03A9F4">from</span> fid <span style="color:#03A9F4">import</span> FiDT5
3
 
4
+ tokenizer = T5Tokenizer.from_pretrained(<span style="color:#FF9800">"t5-base"</span>)
5
+
6
  question = <span style="color:#FF9800">"question:"</span>
7
  title = <span style="color:#FF9800">"title:"</span>
8
  context = <span style="color:#FF9800">"context:"</span>
9
+ tokenizer.add_tokens([question, title, context], special_tokens=<span style="color:#8BC34A">True</span>)
10
+ config = AutoConfig.from_pretrained(<span style="color:#FF9800">"t5-base"</span>)
11
+ model = FiDT5.from_pretrained(
12
+ <span style="color:#FF9800">"xfact/FiD-NQ"</span>,
13
+ config=<span style="color:#8BC34A">config</span>
14
+ )
 
15
  ```