Spaces:
Runtime error
Runtime error
Upload 6 files
Browse files- app.py +3 -3
- utils/retriever.py +1 -1
app.py
CHANGED
@@ -38,7 +38,7 @@ data = get_data()
|
|
38 |
|
39 |
col1, col2 = st.columns([3, 3], gap="medium")
|
40 |
|
41 |
-
instructor_model = get_instructor_embedding_model()
|
42 |
instructor_model_api = get_instructor_embedding_model_api()
|
43 |
|
44 |
|
@@ -105,7 +105,7 @@ dense_array = np.array(json_dict["data"], dtype=np.float64)
|
|
105 |
dense_embedding_api = dense_array.tolist()
|
106 |
|
107 |
|
108 |
-
dense_embedding = instructor_model.encode([[query_embedding_instruction, query_text]]).tolist()
|
109 |
|
110 |
|
111 |
text_embedding_instructions_choice = [
|
@@ -144,7 +144,7 @@ with col2:
|
|
144 |
pinecone_index = pinecone.Index(pinecone_index_name)
|
145 |
|
146 |
matches = query_pinecone(
|
147 |
-
dense_vec=
|
148 |
)
|
149 |
context = format_query(matches)
|
150 |
output_text = format_context(context)
|
|
|
38 |
|
39 |
col1, col2 = st.columns([3, 3], gap="medium")
|
40 |
|
41 |
+
#instructor_model = get_instructor_embedding_model()
|
42 |
instructor_model_api = get_instructor_embedding_model_api()
|
43 |
|
44 |
|
|
|
105 |
dense_embedding_api = dense_array.tolist()
|
106 |
|
107 |
|
108 |
+
#dense_embedding = instructor_model.encode([[query_embedding_instruction, query_text]]).tolist()
|
109 |
|
110 |
|
111 |
text_embedding_instructions_choice = [
|
|
|
144 |
pinecone_index = pinecone.Index(pinecone_index_name)
|
145 |
|
146 |
matches = query_pinecone(
|
147 |
+
dense_vec=dense_embedding_api, top_k=num_results, index=pinecone_index, indices=indices
|
148 |
)
|
149 |
context = format_query(matches)
|
150 |
output_text = format_context(context)
|
utils/retriever.py
CHANGED
@@ -30,7 +30,7 @@ def format_query(query_results):
|
|
30 |
def format_context(context):
|
31 |
output_text = []
|
32 |
for text, score in context:
|
33 |
-
output_text.append(f"Text: {text}\nCosine Similarity: {score}")
|
34 |
return output_text
|
35 |
|
36 |
|
|
|
30 |
def format_context(context):
|
31 |
output_text = []
|
32 |
for text, score in context:
|
33 |
+
output_text.append(f"Text: {text}\n\nCosine Similarity: {score}")
|
34 |
return output_text
|
35 |
|
36 |
|