|
|
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) |
|
|
|
|
|
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() |