Spaces:
Sleeping
Sleeping
tebicap commited on
Commit ·
a7be45a
1
Parent(s): 27f023c
truncado sino no anda, y live cambiado a False
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ tokenizer = T5Tokenizer.from_pretrained(model_name)
|
|
| 9 |
# Define a function to generate text using T5
|
| 10 |
def generate_text(prompt):
|
| 11 |
# Tokenize input and generate output
|
| 12 |
-
input_ids = tokenizer.encode(prompt, return_tensors="pt", max_length=512, truncation=
|
| 13 |
output_ids = model.generate(input_ids)
|
| 14 |
|
| 15 |
# Decode the generated output
|
|
@@ -22,7 +22,7 @@ iface = gr.Interface(
|
|
| 22 |
fn=generate_text,
|
| 23 |
inputs=gr.Textbox(),
|
| 24 |
outputs=gr.Textbox(),
|
| 25 |
-
live=
|
| 26 |
title="T5 Text Generation",
|
| 27 |
description="Enter a prompt, and the model will generate text based on it."
|
| 28 |
)
|
|
|
|
| 9 |
# Define a function to generate text using T5
|
| 10 |
def generate_text(prompt):
|
| 11 |
# Tokenize input and generate output
|
| 12 |
+
input_ids = tokenizer.encode(prompt, return_tensors="pt", max_length=512, truncation=True)
|
| 13 |
output_ids = model.generate(input_ids)
|
| 14 |
|
| 15 |
# Decode the generated output
|
|
|
|
| 22 |
fn=generate_text,
|
| 23 |
inputs=gr.Textbox(),
|
| 24 |
outputs=gr.Textbox(),
|
| 25 |
+
live=False,
|
| 26 |
title="T5 Text Generation",
|
| 27 |
description="Enter a prompt, and the model will generate text based on it."
|
| 28 |
)
|