Spaces:
Sleeping

duvr's picture
improve file organization
fe45c80
Raw History Blame Contribute Delete
590 Bytes
import gradio as gr
from src.config import langs, models
from src.predict import predict
with gr.Blocks() as demo:
gr.Markdown("# Análisis de Sentimientos")
# Mostrar el lenguaje y modelo en la misma línea
with gr.Row():
lang = gr.Radio(choices=langs, label="Lang", value=langs[0])
model = gr.Dropdown(choices=models, label="Model", interactive=True)
text = gr.Textbox(label="Input")
output = gr.Label(label="Output")
predict_btn = gr.Button("Predict")
predict_btn.click(fn=predict, inputs=[lang, model, text], outputs=output)
demo.launch()