ybelkada commited on
Commit
0073e6d
1 Parent(s): c0989c6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -9
README.md CHANGED
@@ -154,8 +154,8 @@ Find below some example scripts on how to use the model in `transformers`:
154
 
155
  from transformers import T5Tokenizer, T5ForConditionalGeneration
156
 
157
- tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-large")
158
- model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-large")
159
 
160
  input_text = "translate English to German: How old are you?"
161
  input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids
@@ -175,8 +175,8 @@ print(tokenizer.decode(outputs[0]))
175
  # pip install accelerate
176
  from transformers import T5Tokenizer, T5ForConditionalGeneration
177
 
178
- tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-large")
179
- model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-large", device_map="auto")
180
 
181
  input_text = "translate English to German: How old are you?"
182
  input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids.to("cuda")
@@ -199,8 +199,8 @@ print(tokenizer.decode(outputs[0]))
199
  import torch
200
  from transformers import T5Tokenizer, T5ForConditionalGeneration
201
 
202
- tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-large")
203
- model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-large", device_map="auto", torch_dtype=torch.float16)
204
 
205
  input_text = "translate English to German: How old are you?"
206
  input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids.to("cuda")
@@ -220,8 +220,8 @@ print(tokenizer.decode(outputs[0]))
220
  # pip install bitsandbytes accelerate
221
  from transformers import T5Tokenizer, T5ForConditionalGeneration
222
 
223
- tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-large")
224
- model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-large", device_map="auto", load_in_8bit=True)
225
 
226
  input_text = "translate English to German: How old are you?"
227
  input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids.to("cuda")
@@ -292,7 +292,7 @@ For full details, please check the [research paper](https://arxiv.org/pdf/2210.1
292
 
293
  ## Results
294
 
295
- For full results for FLAN-T5-Large, see the [research paper](https://arxiv.org/pdf/2210.11416.pdf), Table 3.
296
 
297
  # Environmental Impact
298
 
 
154
 
155
  from transformers import T5Tokenizer, T5ForConditionalGeneration
156
 
157
+ tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-xl")
158
+ model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-xl")
159
 
160
  input_text = "translate English to German: How old are you?"
161
  input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids
 
175
  # pip install accelerate
176
  from transformers import T5Tokenizer, T5ForConditionalGeneration
177
 
178
+ tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-xl")
179
+ model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-xl", device_map="auto")
180
 
181
  input_text = "translate English to German: How old are you?"
182
  input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids.to("cuda")
 
199
  import torch
200
  from transformers import T5Tokenizer, T5ForConditionalGeneration
201
 
202
+ tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-xl")
203
+ model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-xl", device_map="auto", torch_dtype=torch.float16)
204
 
205
  input_text = "translate English to German: How old are you?"
206
  input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids.to("cuda")
 
220
  # pip install bitsandbytes accelerate
221
  from transformers import T5Tokenizer, T5ForConditionalGeneration
222
 
223
+ tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-xl")
224
+ model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-xl", device_map="auto", load_in_8bit=True)
225
 
226
  input_text = "translate English to German: How old are you?"
227
  input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids.to("cuda")
 
292
 
293
  ## Results
294
 
295
+ For full results for FLAN-T5-XL, see the [research paper](https://arxiv.org/pdf/2210.11416.pdf), Table 3.
296
 
297
  # Environmental Impact
298