vectorAPI / app.py
summerstay's picture
Update app.py
90d1b9e
raw
history blame
589 Bytes
import gradio as gr
from sentence_transformers import SentenceTransformer
model_Q = SentenceTransformer('flax-sentence-embeddings/multi-QA_v1-mpnet-asymmetric-Q')
def getVectors(sentences):
vectors = []
splitSentences = sentences.split('/*/')
for sentence in sentences:
vectors.append(model_Q.encode(sentence))
return vectors
interface = gr.Interface(fn = getVectors,
inputs = "text",
outputs = ['text'],
title = 'get vectors',
description = 'get vectors for search')
interface.launch(inline = False)