Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,28 +1,32 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
examples = [
|
4 |
-
|
5 |
-
|
6 |
-
]
|
7 |
|
8 |
-
#
|
9 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
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 |
-
|
27 |
-
|
|
|
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 |
|