Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,8 +12,8 @@ examples = [
|
|
12 |
|
13 |
models = [
|
14 |
"sinonimayzer/UzRoBERTa-v1",
|
15 |
-
"
|
16 |
-
"
|
17 |
]
|
18 |
|
19 |
def df(arr):
|
@@ -23,21 +23,22 @@ def df(arr):
|
|
23 |
return d
|
24 |
|
25 |
def fn(text):
|
|
|
26 |
for model in models:
|
27 |
-
|
28 |
-
|
29 |
|
30 |
with gr.Blocks() as demo:
|
31 |
with gr.Row():
|
32 |
with gr.Column():
|
33 |
-
|
34 |
-
|
35 |
with gr.Column():
|
36 |
-
|
37 |
-
|
38 |
btn = gr.Button("Check")
|
39 |
-
btn.click(fn, inputs=[
|
40 |
-
gr.Examples(examples, fn=fn, inputs=[
|
41 |
|
42 |
if __name__ == "__main__":
|
43 |
demo.queue().launch()
|
|
|
12 |
|
13 |
models = [
|
14 |
"sinonimayzer/UzRoBERTa-v1",
|
15 |
+
"tahrirchi/tahrirchi-bert-base",
|
16 |
+
"rifkat/uztext-3Gb-BPE-Roberta"
|
17 |
]
|
18 |
|
19 |
def df(arr):
|
|
|
23 |
return d
|
24 |
|
25 |
def fn(text):
|
26 |
+
result = ()
|
27 |
for model in models:
|
28 |
+
result = result + df(pipeline("fill-mask", model=model))
|
29 |
+
return result
|
30 |
|
31 |
with gr.Blocks() as demo:
|
32 |
with gr.Row():
|
33 |
with gr.Column():
|
34 |
+
output0 = gr.Label(label=models[0])
|
35 |
+
input = gr.Textbox(label="Input", lines=10, value=examples[0])
|
36 |
with gr.Column():
|
37 |
+
output1 = gr.Label(label=models[1])
|
38 |
+
output2 = gr.Label(label=models[2])
|
39 |
btn = gr.Button("Check")
|
40 |
+
btn.click(fn, inputs=[input], outputs=[output0, output1, output2])
|
41 |
+
gr.Examples(examples, fn=fn, inputs=[input], outputs=[output0, output1, output2], cache_examples=True, batch=True)
|
42 |
|
43 |
if __name__ == "__main__":
|
44 |
demo.queue().launch()
|