Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ from InstructorEmbedding import INSTRUCTOR
|
|
5 |
model = INSTRUCTOR('hkunlp/instructor-xl')
|
6 |
|
7 |
def create_embedding(query_instruction, query):
|
8 |
-
embeddings = model.encode([[query_instruction, query]])[0]
|
9 |
-
|
10 |
return embeddings
|
11 |
|
12 |
instructor_model_embeddings = gr.Interface(
|
@@ -15,6 +15,6 @@ instructor_model_embeddings = gr.Interface(
|
|
15 |
gr.inputs.Textbox(label="Query_Instruction"),
|
16 |
gr.inputs.Textbox(label="Query")
|
17 |
],
|
18 |
-
outputs="
|
19 |
title="API-Instructor-XL-1",
|
20 |
).launch()
|
|
|
5 |
model = INSTRUCTOR('hkunlp/instructor-xl')
|
6 |
|
7 |
def create_embedding(query_instruction, query):
|
8 |
+
embeddings = model.encode([[query_instruction, query]])[0]
|
9 |
+
embeddings_array = np.array(embeddings)
|
10 |
return embeddings
|
11 |
|
12 |
instructor_model_embeddings = gr.Interface(
|
|
|
15 |
gr.inputs.Textbox(label="Query_Instruction"),
|
16 |
gr.inputs.Textbox(label="Query")
|
17 |
],
|
18 |
+
outputs="numpy",
|
19 |
title="API-Instructor-XL-1",
|
20 |
).launch()
|