Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,4 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
"text2text-generation", # Tipo correcto para FLAN-T5
|
| 6 |
-
model="google/flan-t5-small"
|
| 7 |
-
)
|
| 8 |
-
|
| 9 |
-
print("IA lista. Escribe 'salir' para terminar.")
|
| 10 |
-
|
| 11 |
-
while True:
|
| 12 |
-
pregunta = input("T煤: ")
|
| 13 |
-
if pregunta.lower() in ["salir", "exit"]:
|
| 14 |
-
break
|
| 15 |
-
|
| 16 |
-
respuesta = chatbot(pregunta, max_length=100)
|
| 17 |
-
print("IA:", respuesta[0]["generated_text"])
|
|
|
|
| 1 |
+
inputs = tokenizer("驴C贸mo est谩s?", return_tensors="pt")
|
| 2 |
+
outputs = model.generate(**inputs)
|
| 3 |
+
respuesta = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 4 |
+
print(respuesta)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|