Surajrgl's picture
Update app.py
09ceb31
raw
history blame
524 Bytes
from sentence_transformers import SentenceTransformer
import gradio as gr
model = SentenceTransformer('sentence-transformers/multi-qa-mpnet-base-cos-v1')
def generate_embedding(query):
# return "Connected"
embeddings = model.encode(query)
# resposne = ""
# for(char in embeddings):
# resposne += char + " "
mySeparator = " "
resposne = embeddings.join(mySeparator)
return resposne
demo = gr.Interface(fn=generate_embedding, inputs="text", outputs="text")
demo.launch( show_api=True)