Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ vectorstore_persisted = Chroma(
|
|
35 |
persist_directory='./report_10K_db',
|
36 |
embedding_function=embedding_model
|
37 |
)
|
38 |
-
|
39 |
vectorstore_retriever = vectorstore_persisted.as_retriever(
|
40 |
search_type='similarity',
|
41 |
search_kwargs={'k': 5}
|
@@ -128,11 +128,11 @@ def predict(user_input,company):
|
|
128 |
messages=prompt,
|
129 |
temperature=0
|
130 |
)
|
131 |
-
|
132 |
prediction = response.choices[0].message.content.strip()
|
133 |
except Exception as e:
|
134 |
prediction = f'Sorry, I encountered the following error: \n {e}'
|
135 |
-
|
136 |
# While the prediction is made, log both the inputs and outputs to a local log file
|
137 |
# While writing to the log file, ensure that the commit scheduler is locked to avoid parallel
|
138 |
# access
|
|
|
35 |
persist_directory='./report_10K_db',
|
36 |
embedding_function=embedding_model
|
37 |
)
|
38 |
+
print(vectorstore_persisted.similarity_search("aws AI presence",k=4))
|
39 |
vectorstore_retriever = vectorstore_persisted.as_retriever(
|
40 |
search_type='similarity',
|
41 |
search_kwargs={'k': 5}
|
|
|
128 |
messages=prompt,
|
129 |
temperature=0
|
130 |
)
|
131 |
+
print("response",response)
|
132 |
prediction = response.choices[0].message.content.strip()
|
133 |
except Exception as e:
|
134 |
prediction = f'Sorry, I encountered the following error: \n {e}'
|
135 |
+
|
136 |
# While the prediction is made, log both the inputs and outputs to a local log file
|
137 |
# While writing to the log file, ensure that the commit scheduler is locked to avoid parallel
|
138 |
# access
|