Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,20 +10,18 @@ def fn(text):
|
|
10 |
uzroberta_v1 = pipeline("fill-mask", model="sinonimayzer/UzRoBERTa-v1")
|
11 |
roberta_1_8_v2 = pipeline("fill-mask", model="sinonimayzer/roberta-1.8-v2")
|
12 |
return uzroberta_v1(text), roberta_1_8_v2(text)
|
13 |
-
|
14 |
-
demo = gr.Interface(
|
15 |
-
fn,
|
16 |
-
inputs=gr.Textbox(lines=5, max_lines=6, label="Input"),
|
17 |
-
outputs=[gr.Label(label="UzRoBERTa-v1"), gr.Label(label="roberta-1.8-v2")],
|
18 |
-
examples=examples,
|
19 |
-
)
|
20 |
-
|
21 |
-
# with gr.Blocks() as demo:
|
22 |
-
# with gr.Tab("UzRoBERTa-v1"):
|
23 |
-
# gr.load("sinonimayzer/UzRoBERTa-v1", src="models")
|
24 |
-
# with gr.Tab("roberta-1.8-v2"):
|
25 |
-
# gr.load("sinonimayzer/roberta-1.8-v2", src="models")
|
26 |
-
|
27 |
-
# demo.launch()
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
|
|
|
|
|
10 |
uzroberta_v1 = pipeline("fill-mask", model="sinonimayzer/UzRoBERTa-v1")
|
11 |
roberta_1_8_v2 = pipeline("fill-mask", model="sinonimayzer/roberta-1.8-v2")
|
12 |
return uzroberta_v1(text), roberta_1_8_v2(text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
+
with gr.Blocks() as demo:
|
15 |
+
with gr.Row():
|
16 |
+
with gr.Column():
|
17 |
+
input = gr.Text(label="Input")
|
18 |
+
with gr.Column():
|
19 |
+
output1 = gr.Label(label="UzRoBERTa-v1")
|
20 |
+
output2 = gr.Text(label="roberta-1.8-v2")
|
21 |
+
|
22 |
+
btn = gr.Button("Generate")
|
23 |
+
btn.click(fn, inputs=[input], outputs=[output1, output2])
|
24 |
+
gr.Examples(examples, inputs=[input])
|
25 |
|
26 |
+
if __name__ == "__main__":
|
27 |
+
demo.launch()
|