Spaces:
Runtime error
Runtime error
import gradio as gr | |
examples = [ | |
['The goal of life is <mask>.',''] | |
] | |
uzroberta_v1 = gr.Interface.load("sinonimayzer/UzRoBERTa-v1", src="models") | |
roberta_1_8_v2 = gr.Interface.load("sinonimayzer/roberta-1.8-v2", src="models") | |
def inference(input, model): | |
if model == "UzRoBERTa-v1": | |
result = uzroberta_v1(input) | |
else: | |
result = roberta_1_8_v2(input) | |
return result | |
gr.Interface( | |
inference, | |
[ | |
gr.inputs.Textbox(label="Context", lines=10), | |
gr.inputs.Dropdown(choices=["UzRoBERTa-v1","roberta-1.8-v2"], type="value", default="UzRoBERTa-v1", label="model") | |
], | |
[ | |
gr.outputs.Label(label="Output") | |
], | |
examples=examples).launch(enable_queue=True) | |