Update app.py
Browse files
app.py
CHANGED
@@ -6,12 +6,12 @@ model = SentenceTransformer('sentence-transformers/multi-qa-mpnet-base-cos-v1')
|
|
6 |
|
7 |
def generate_embedding(query):
|
8 |
# return "Connected"
|
9 |
-
embeddings = model.encode(query)
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
mySeparator = " "
|
14 |
-
resposne = mySeparator.join(embeddings)
|
15 |
return resposne
|
16 |
|
17 |
demo = gr.Interface(fn=generate_embedding, inputs="text", outputs="text")
|
|
|
6 |
|
7 |
def generate_embedding(query):
|
8 |
# return "Connected"
|
9 |
+
embeddings = model.encode(query)
|
10 |
+
resposne = ""
|
11 |
+
for(char in embeddings.tolist()):
|
12 |
+
resposne += str(char) + " "
|
13 |
+
# mySeparator = " "
|
14 |
+
# resposne = mySeparator.join(embeddings.tolist())
|
15 |
return resposne
|
16 |
|
17 |
demo = gr.Interface(fn=generate_embedding, inputs="text", outputs="text")
|