Spaces:
Runtime error
Runtime error
Upload 6 files
Browse files
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_array = np.array(json_dict["data"]
|
102 |
dense_embedding = dense_array.tolist()
|
103 |
|
104 |
text_embedding_instructions_choice = [
|
@@ -126,16 +126,16 @@ with col2:
|
|
126 |
text_embedding_instructions_choice,
|
127 |
)
|
128 |
|
129 |
-
pinecone_index_name = index_mapping[text_embedding_instruction]
|
130 |
-
pinecone.init(
|
131 |
-
api_key=st.secrets[f"pinecone_{pinecone_index_name}"],
|
132 |
-
environment="asia-southeast1-gcp-free",
|
133 |
-
)
|
134 |
-
|
135 |
-
pinecone_index = pinecone.Index(pinecone_index_name)
|
136 |
-
|
137 |
submitted = st.form_submit_button("Submit")
|
138 |
if submitted:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
matches = query_pinecone(
|
140 |
dense_embedding, num_results, pinecone_index, indices
|
141 |
)
|
|
|
98 |
|
99 |
json_file = open(json_output_embedding, "r")
|
100 |
json_dict = json.load(json_file)
|
101 |
+
dense_array = np.array(json_dict["data"], dtype=np.float64)
|
102 |
dense_embedding = dense_array.tolist()
|
103 |
|
104 |
text_embedding_instructions_choice = [
|
|
|
126 |
text_embedding_instructions_choice,
|
127 |
)
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
submitted = st.form_submit_button("Submit")
|
130 |
if submitted:
|
131 |
+
pinecone_index_name = index_mapping[text_embedding_instruction]
|
132 |
+
pinecone.init(
|
133 |
+
api_key=st.secrets[f"pinecone_{pinecone_index_name}"],
|
134 |
+
environment="asia-southeast1-gcp-free",
|
135 |
+
)
|
136 |
+
|
137 |
+
pinecone_index = pinecone.Index(pinecone_index_name)
|
138 |
+
|
139 |
matches = query_pinecone(
|
140 |
dense_embedding, num_results, pinecone_index, indices
|
141 |
)
|