Spaces:
Paused
Paused
Commit
·
4db03af
1
Parent(s):
98220f7
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,7 +33,7 @@ def generate_text(text):
|
|
| 33 |
input_text = text
|
| 34 |
input_ids = tokenizer.encode(input_text, return_tensors="pt").to("cuda")
|
| 35 |
output_ids = model.generate(input_ids, generation_config=generation_config)
|
| 36 |
-
output_text = tokenizer.decode(output_ids, skip_special_tokens=True)
|
| 37 |
return output_text
|
| 38 |
|
| 39 |
iface = gr.Interface(fn=generate_text, inputs="text", outputs="text")
|
|
|
|
| 33 |
input_text = text
|
| 34 |
input_ids = tokenizer.encode(input_text, return_tensors="pt").to("cuda")
|
| 35 |
output_ids = model.generate(input_ids, generation_config=generation_config)
|
| 36 |
+
output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
| 37 |
return output_text
|
| 38 |
|
| 39 |
iface = gr.Interface(fn=generate_text, inputs="text", outputs="text")
|