File size: 586 Bytes
ae53f18
 
06aae6f
 
eb548ff
06aae6f
 
 
f04a85b
d9d60a2
0da8350
d9d60a2
06aae6f
 
 
 
 
 
 
90d1b9e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

import gradio as gr
from sentence_transformers import SentenceTransformer

model_Q = SentenceTransformer('sentence-transformers/all-mpnet-base-v2')

def getVectors(sentences):
            vectors = []
            splitSentences = sentences.split('ZZZ')
            for sentence in splitSentences:
                       vectors.append(model_Q.encode(sentence).tolist())
            return vectors
            
interface = gr.Interface(fn = getVectors,
inputs = "text",
outputs = ['text'],
title = 'get vectors',
description = 'get vectors for search')

interface.launch(inline = False)