File size: 930 Bytes
76c91f8 55b1ed1 76c91f8 a31410f 76c91f8 55b1ed1 76c91f8 5dc677f 55b1ed1 5dc677f 55b1ed1 6c83fea a31410f 8c599d6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import gradio as gr
from inference import inference
import os
theme = theme = gr.themes.Soft(
primary_hue="red",
secondary_hue="red",
)
salute = f"""
👋 ¡Bienvenido a Ticio!
Ten en cuenta que la primera respuesta en cada chat puede tardar unos 30 segundos.
Recuerda no pedir fallos específicos, sino más bien temas o áreas.
Para más información sobre cómo sacarle el mejor provecho a Ticio, lee este artículo: {os.environ['link']}
"""
with gr.Blocks(theme = theme) as demo:
chatbot = gr.Chatbot(type="messages",
value=[{"role": "assistant", "content": salute}]
)
hidden_text = gr.Textbox(visible = False) # Added hidden text component
gr.ChatInterface(fn=inference, chatbot=chatbot, type="messages", additional_inputs= hidden_text, additional_outputs= hidden_text, save_history= True, show_api= False).render()
demo.launch() |