Mansurbek commited on
Commit
55cf1f0
1 Parent(s): 59ae791

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -22
app.py CHANGED
@@ -1,28 +1,32 @@
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
- #uzroberta_v1 = gr.Interface.load()
9
- #roberta_1_8_v2 = gr.Interface.load("sinonimayzer/roberta-1.8-v2")
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
- def fn(text):
12
- uzroberta_v1 = pipeline("fill-mask", model="sinonimayzer/UzRoBERTa-v1")
13
- roberta_1_8_v2 = pipeline("fill-mask", model="sinonimayzer/roberta-1.8-v2")
14
- return [
15
- uzroberta_v1(text),
16
- roberta_1_8_v2(text)
17
- ]
18
- demo = gr.load(
19
- "sinonimayzer/UzRoBERTa-v1",
20
- inputs=gr.Textbox(lines=5, max_lines=6, label="Input"),
21
- outputs=[gr.Label(label="UzRoBERTa-v1"), gr.Label(label="roberta-1.8-v2")],
22
- examples=examples,
23
- src="models",
24
- )
25
 
26
- if __name__ == "__main__":
27
- demo.launch()
 
28
 
 
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
+ demo.launch()
32