Spaces:
Sleeping
Sleeping
Upload app.py
#2
by
awinml
- opened
app.py
CHANGED
@@ -4,7 +4,7 @@ from InstructorEmbedding import INSTRUCTOR
|
|
4 |
model = INSTRUCTOR('hkunlp/instructor-xl')
|
5 |
|
6 |
def create_embedding(instruction, sentence):
|
7 |
-
embeddings = model.encode([[
|
8 |
print("Embeddings:", embeddings)
|
9 |
return embeddings
|
10 |
|
@@ -14,6 +14,6 @@ instructor_model_embeddings = gr.Interface(
|
|
14 |
gr.inputs.Textbox(label="Query_Instruction"),
|
15 |
gr.inputs.Textbox(label="Query")
|
16 |
],
|
17 |
-
outputs="
|
18 |
title="API-Instructor-XL-1",
|
19 |
).launch()
|
|
|
4 |
model = INSTRUCTOR('hkunlp/instructor-xl')
|
5 |
|
6 |
def create_embedding(instruction, sentence):
|
7 |
+
embeddings = model.encode([[query_instruction, query]]).tolist()
|
8 |
print("Embeddings:", embeddings)
|
9 |
return embeddings
|
10 |
|
|
|
14 |
gr.inputs.Textbox(label="Query_Instruction"),
|
15 |
gr.inputs.Textbox(label="Query")
|
16 |
],
|
17 |
+
outputs="list",
|
18 |
title="API-Instructor-XL-1",
|
19 |
).launch()
|