Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from sentence_transformers import SentenceTransformer
|
3 |
+
|
4 |
+
model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
5 |
+
|
6 |
+
def encode_sentences(sentences):
|
7 |
+
embeddings = model.encode(sentences)
|
8 |
+
return embeddings
|
9 |
+
|
10 |
+
demo = gr.Interface(fn=encode_sentences,
|
11 |
+
inputs="textbox",
|
12 |
+
outputs="text")
|
13 |
+
|
14 |
+
if __name__ == "__main__":
|
15 |
+
demo.launch()
|