Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,18 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
from transformers import pipeline
|
| 3 |
-
|
| 4 |
-
# Modelo ligero y más coherente
|
| 5 |
-
chatbot = pipeline("text-generation", model="mrm8488/t5-base-spanish-summarization")
|
| 6 |
-
|
| 7 |
-
def respond(message, history):
|
| 8 |
-
if not message:
|
| 9 |
-
return "Pregúntame algo 😊"
|
| 10 |
-
|
| 11 |
-
prompt = "Responde en español de forma clara y amigable: " + message
|
| 12 |
-
response = chatbot(prompt, max_length=100, do_sample=False)
|
| 13 |
-
|
| 14 |
-
return response[0]["generated_text"]
|
| 15 |
-
|
| 16 |
-
demo = gr.ChatInterface(fn=respond)
|
| 17 |
-
|
| 18 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|