awinml commited on
Commit
6bca98e
1 Parent(s): e69943f

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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].tolist()
9
- #embeddings_array = np.array(embeddings)
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="list",
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()