ybelkada commited on
Commit
0394f94
1 Parent(s): 99ac30c

Update README.md (#2)

Browse files

- Update README.md (8332223e6d2e8749732bc5157779bea926d00167)

Files changed (1) hide show
  1. README.md +4 -4
README.md CHANGED
@@ -159,7 +159,7 @@ tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small")
159
  model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small")
160
 
161
  input_text = "translate English to German: How old are you?"
162
- input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids
163
 
164
  outputs = model.generate(input_ids)
165
  print(tokenizer.decode(outputs[0]))
@@ -180,7 +180,7 @@ tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small")
180
  model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small", device_map="auto")
181
 
182
  input_text = "translate English to German: How old are you?"
183
- input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids.to("cuda")
184
 
185
  outputs = model.generate(input_ids)
186
  print(tokenizer.decode(outputs[0]))
@@ -204,7 +204,7 @@ tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small")
204
  model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small", device_map="auto", torch_dtype=torch.float16)
205
 
206
  input_text = "translate English to German: How old are you?"
207
- input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids.to("cuda")
208
 
209
  outputs = model.generate(input_ids)
210
  print(tokenizer.decode(outputs[0]))
@@ -225,7 +225,7 @@ tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small")
225
  model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small", device_map="auto", load_in_8bit=True)
226
 
227
  input_text = "translate English to German: How old are you?"
228
- input_ids = tokenizer.encode(input_text, return_tensors="pt").input_ids.to("cuda")
229
 
230
  outputs = model.generate(input_ids)
231
  print(tokenizer.decode(outputs[0]))
 
159
  model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small")
160
 
161
  input_text = "translate English to German: How old are you?"
162
+ input_ids = tokenizer(input_text, return_tensors="pt").input_ids
163
 
164
  outputs = model.generate(input_ids)
165
  print(tokenizer.decode(outputs[0]))
 
180
  model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small", device_map="auto")
181
 
182
  input_text = "translate English to German: How old are you?"
183
+ input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
184
 
185
  outputs = model.generate(input_ids)
186
  print(tokenizer.decode(outputs[0]))
 
204
  model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small", device_map="auto", torch_dtype=torch.float16)
205
 
206
  input_text = "translate English to German: How old are you?"
207
+ input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
208
 
209
  outputs = model.generate(input_ids)
210
  print(tokenizer.decode(outputs[0]))
 
225
  model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small", device_map="auto", load_in_8bit=True)
226
 
227
  input_text = "translate English to German: How old are you?"
228
+ input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
229
 
230
  outputs = model.generate(input_ids)
231
  print(tokenizer.decode(outputs[0]))