Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ import pickle
|
|
9 |
setattr(httpcore, 'SyncHTTPTransport', 'AsyncHTTPProxy')
|
10 |
|
11 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
|
12 |
|
13 |
def get_detailed_instruct(task_description: str, query: str) -> str:
|
14 |
return f'Instruct: {task_description}\nQuery: {query}'
|
@@ -35,7 +36,6 @@ def respond(message,
|
|
35 |
get_detailed_instruct(task, message)
|
36 |
]
|
37 |
|
38 |
-
model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
|
39 |
query_embeddings = model.encode(queries, convert_to_tensor=True, normalize_embeddings=True)
|
40 |
scores = (query_embeddings @ encoded_questions.T) * 100
|
41 |
selected_references['similarity'] = scores.tolist()[0]
|
|
|
9 |
setattr(httpcore, 'SyncHTTPTransport', 'AsyncHTTPProxy')
|
10 |
|
11 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
12 |
+
model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
|
13 |
|
14 |
def get_detailed_instruct(task_description: str, query: str) -> str:
|
15 |
return f'Instruct: {task_description}\nQuery: {query}'
|
|
|
36 |
get_detailed_instruct(task, message)
|
37 |
]
|
38 |
|
|
|
39 |
query_embeddings = model.encode(queries, convert_to_tensor=True, normalize_embeddings=True)
|
40 |
scores = (query_embeddings @ encoded_questions.T) * 100
|
41 |
selected_references['similarity'] = scores.tolist()[0]
|