Spaces:
Runtime error
Runtime error
shibing624
commited on
Commit
•
883cddb
1
Parent(s):
785279d
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,8 @@
|
|
4 |
@description: text similarity example, fine-tuned by CoSENT model
|
5 |
"""
|
6 |
import gradio as gr
|
|
|
|
|
7 |
from text2vec import Similarity
|
8 |
|
9 |
# 中文句向量模型(CoSENT)
|
@@ -25,10 +27,10 @@ if __name__ == '__main__':
|
|
25 |
['一个女人在看书。', '一个女人在揉面团'],
|
26 |
['一个男人在车库里举重。', '一个人在举重。'],
|
27 |
]
|
28 |
-
input1 =
|
29 |
-
input2 =
|
30 |
|
31 |
-
output_text =
|
32 |
gr.Interface(ai_text,
|
33 |
inputs=[input1, input2],
|
34 |
outputs=[output_text],
|
|
|
4 |
@description: text similarity example, fine-tuned by CoSENT model
|
5 |
"""
|
6 |
import gradio as gr
|
7 |
+
from gradio.components import Textbox
|
8 |
+
|
9 |
from text2vec import Similarity
|
10 |
|
11 |
# 中文句向量模型(CoSENT)
|
|
|
27 |
['一个女人在看书。', '一个女人在揉面团'],
|
28 |
['一个男人在车库里举重。', '一个人在举重。'],
|
29 |
]
|
30 |
+
input1 = Textbox(lines=2, placeholder="Enter First Sentence")
|
31 |
+
input2 = Textbox(lines=2, placeholder="Enter Second Sentence")
|
32 |
|
33 |
+
output_text = Textbox(lines=2, placeholder="Output scores")
|
34 |
gr.Interface(ai_text,
|
35 |
inputs=[input1, input2],
|
36 |
outputs=[output_text],
|