text-embeddings / app.py
hesha's picture
Create app.py
8b66f10
raw
history blame contribute delete
447 Bytes
import gradio as gr
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
def encode_sentences(sentences):
embeddings = model.encode(sentences)
return embeddings
demo = gr.Interface(fn=encode_sentences,
inputs="textbox",
outputs="text")
if __name__ == "__main__":
demo.launch()