Spaces:
Sleeping
Sleeping
tebicap commited on
Commit ·
13855c2
1
Parent(s): 4aaf034
vuelvo a lo de antes, más pruebas
Browse files
app.py
CHANGED
|
@@ -9,8 +9,8 @@ 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 |
-
|
| 13 |
-
input_ids = tokenizer.encode(prompt, return_tensors="pt").input_ids
|
| 14 |
|
| 15 |
output_ids = model.generate(input_ids)
|
| 16 |
|
|
|
|
| 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 |
+
#input_ids = tokenizer.encode(prompt, return_tensors="pt").input_ids
|
| 14 |
|
| 15 |
output_ids = model.generate(input_ids)
|
| 16 |
|