Mansurbek commited on
Commit
ef3e238
1 Parent(s): 302b6e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -24
app.py CHANGED
@@ -1,31 +1,31 @@
1
  import gradio as gr
2
 
3
- # examples = [
4
- # 'Kuchli yomg‘irlar tufayli bir qator <mask> kuchli sel oqishi kuzatildi.',
5
- # 'Shu munosabat bilan O‘zbekiston Prezidenti global inqiroz sharoitida savdo-iqtisodiy hamkorlikni <mask> va hududlararo aloqalarni rivojlantirishning muhim masalalariga to‘xtalib o‘tdi.',
6
- # ]
7
 
8
- # def fn(text):
9
- # uzroberta_v1 = pipeline("fill-mask", model="sinonimayzer/UzRoBERTa-v1")
10
- # roberta_1_8_v2 = pipeline("fill-mask", model="sinonimayzer/roberta-1.8-v2")
11
- # return [
12
- # uzroberta_v1(text),
13
- # roberta_1_8_v2(text)
14
- # ]
15
- # demo = gr.load(
16
- # "sinonimayzer/UzRoBERTa-v1",
17
- # inputs=gr.Textbox(lines=5, max_lines=6, label="Input"),
18
- # outputs=[gr.Label(label="UzRoBERTa-v1"), gr.Label(label="roberta-1.8-v2")],
19
- # examples=examples,
20
- # src="models",
21
- # )
22
 
23
- with gr.Blocks() as demo:
24
- with gr.Tab("UzRoBERTa-v1"):
25
- gr.load("sinonimayzer/UzRoBERTa-v1", src="models")
26
- with gr.Tab("roberta-1.8-v2"):
27
- gr.load("sinonimayzer/roberta-1.8-v2", src="models")
28
 
29
- demo.launch()
30
 
31
 
 
1
  import gradio as gr
2
 
3
+ examples = [
4
+ 'Kuchli yomg‘irlar tufayli bir qator <mask> kuchli sel oqishi kuzatildi.',
5
+ 'Shu munosabat bilan O‘zbekiston Prezidenti global inqiroz sharoitida savdo-iqtisodiy hamkorlikni <mask> va hududlararo aloqalarni rivojlantirishning muhim masalalariga to‘xtalib o‘tdi.',
6
+ ]
7
 
8
+ def fn(text):
9
+ uzroberta_v1 = pipeline("fill-mask", model="sinonimayzer/UzRoBERTa-v1")
10
+ roberta_1_8_v2 = pipeline("fill-mask", model="sinonimayzer/roberta-1.8-v2")
11
+ return [
12
+ uzroberta_v1(text),
13
+ roberta_1_8_v2(text)
14
+ ]
15
+ demo = gr.load(
16
+ fn,
17
+ inputs=gr.Textbox(lines=5, max_lines=6, label="Input"),
18
+ outputs=[gr.Label(label="UzRoBERTa-v1"), gr.Label(label="roberta-1.8-v2")],
19
+ examples=examples,
20
+ src="models",
21
+ )
22
 
23
+ # with gr.Blocks() as demo:
24
+ # with gr.Tab("UzRoBERTa-v1"):
25
+ # gr.load("sinonimayzer/UzRoBERTa-v1", src="models")
26
+ # with gr.Tab("roberta-1.8-v2"):
27
+ # gr.load("sinonimayzer/roberta-1.8-v2", src="models")
28
 
29
+ # demo.launch()
30
 
31