Spaces:
Runtime error
Runtime error
File size: 724 Bytes
489c564 49ec14a 1cf8b14 49ec14a 489c564 1cf8b14 |
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 27 28 |
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)
|