Spaces:
Runtime error
Runtime error
Upload 6 files
Browse files- app.py +1 -1
- utils/retriever.py +6 -1
app.py
CHANGED
@@ -98,7 +98,7 @@ json_output_embedding = instructor_model.predict(
|
|
98 |
|
99 |
json_file = open(json_output_embedding, "r")
|
100 |
json_dict = json.load(json_file)
|
101 |
-
dense_embedding =
|
102 |
|
103 |
text_embedding_instructions_choice = [
|
104 |
"Represent the financial statement for retrieval:",
|
|
|
98 |
|
99 |
json_file = open(json_output_embedding, "r")
|
100 |
json_dict = json.load(json_file)
|
101 |
+
dense_embedding = np.array(json_dict["data"][0], dtype=np.float64)
|
102 |
|
103 |
text_embedding_instructions_choice = [
|
104 |
"Represent the financial statement for retrieval:",
|
utils/retriever.py
CHANGED
@@ -1,7 +1,12 @@
|
|
1 |
import numpy as np
|
2 |
|
3 |
|
4 |
-
def query_pinecone(
|
|
|
|
|
|
|
|
|
|
|
5 |
xc = index.query(
|
6 |
vector=dense_vec,
|
7 |
top_k=top_k,
|
|
|
1 |
import numpy as np
|
2 |
|
3 |
|
4 |
+
def query_pinecone(
|
5 |
+
dense_vec,
|
6 |
+
top_k,
|
7 |
+
index,
|
8 |
+
indices
|
9 |
+
):
|
10 |
xc = index.query(
|
11 |
vector=dense_vec,
|
12 |
top_k=top_k,
|