Spaces:
Runtime error
Runtime error
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) |