Spaces:
Sleeping
Sleeping
import gradio as gr | |
from InstructorEmbedding import INSTRUCTOR | |
model = INSTRUCTOR('hkunlp/instructor-xl') | |
def create_embedding(query_instruction, query): | |
embeddings = model.encode([[query_instruction, query]]).tolist() | |
print("Embeddings:", embeddings) | |
return embeddings | |
instructor_model_embeddings = gr.Interface( | |
fn=create_embedding, | |
inputs=[ | |
gr.inputs.Textbox(label="Query_Instruction"), | |
gr.inputs.Textbox(label="Query") | |
], | |
outputs="text", | |
title="API-Instructor-XL-1", | |
).launch() | |