Spaces:
Runtime error
Runtime error
import gradio as gr | |
from models import MODELS, PIPELINES | |
def predict(text: str, model_name: str) -> str: | |
return {"text": PIPELINES[model_name](text)} | |
with gr.Blocks(title="CLARIN-PL Dialogue System Modules") as demo: | |
gr.Markdown("Dialogue State Tracking Modules") | |
for model_name in MODELS: | |
with gr.Row(): | |
gr.Markdown(f"## {model_name}") | |
model_name_component = gr.Textbox(value=model_name, visible=False) | |
with gr.Row(): | |
text_input = gr.Textbox(label="Input Text", value=MODELS[model_name]["default_input"]) | |
gr.Interface(fn=predict, inputs=[text_input, model_name_component], outputs="text") | |
demo.queue(concurrency_count=3) | |
demo.launch() | |