hesha commited on
Commit
8b66f10
·
1 Parent(s): 9253698

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
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()