Mansurbek commited on
Commit
cfa5afa
1 Parent(s): 2f3bb8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -12,8 +12,8 @@ examples = [
12
 
13
  models = [
14
  "sinonimayzer/UzRoBERTa-v1",
15
- "sinonimayzer/roberta-1.8-v2",
16
- "sinonimayzer/roberta-1.0"
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
- yield df(pipeline("fill-mask", model=model))
28
-
29
 
30
  with gr.Blocks() as demo:
31
  with gr.Row():
32
  with gr.Column():
33
- output1 = gr.Label(label="UzRoBERTa-v1")
34
- inp = gr.Textbox(label="Input", lines=10, value=examples[0])
35
  with gr.Column():
36
- output2 = gr.Label(label="roberta-1.8-v2")
37
- output3 = gr.Label(label="roberta-1.0")
38
  btn = gr.Button("Check")
39
- btn.click(fn, inputs=[inp], outputs=[output1, output2, output3])
40
- gr.Examples(examples, fn=fn, inputs=[inp], outputs=[output1, output2, output3], cache_examples=True, batch=True)
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()