Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ load_dotenv() #
|
|
66 |
|
67 |
# groq_api_key = os.environ['GROQ_API_KEY']
|
68 |
groq_api_key = "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" # os.environ['GROQ_API_KEY']
|
69 |
-
print("groq_api_key: ", groq_api_key)
|
70 |
|
71 |
# st.title("Chat with Docs - Groq Edition :) ")
|
72 |
# # st.title ("this is the app title")
|
@@ -249,7 +249,8 @@ if prompt:
|
|
249 |
# Then pass the prompt to the LLM
|
250 |
start = time.process_time()
|
251 |
response = retrieval_chain.invoke({"input": prompt})
|
252 |
-
print(f"Response time: {time.process_time() - start}")
|
|
|
253 |
|
254 |
st.write(response["answer"])
|
255 |
|
@@ -259,6 +260,10 @@ if prompt:
|
|
259 |
for i, doc in enumerate(response["context"]):
|
260 |
# print(doc)
|
261 |
# st.write(f"Source Document # {i+1} : {doc.metadata['source'].split('/')[-1]}")
|
|
|
|
|
|
|
|
|
262 |
st.write(doc.page_content)
|
263 |
st.write("--------------------------------")
|
264 |
|
|
|
66 |
|
67 |
# groq_api_key = os.environ['GROQ_API_KEY']
|
68 |
groq_api_key = "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" # os.environ['GROQ_API_KEY']
|
69 |
+
# print("groq_api_key: ", groq_api_key)
|
70 |
|
71 |
# st.title("Chat with Docs - Groq Edition :) ")
|
72 |
# # st.title ("this is the app title")
|
|
|
249 |
# Then pass the prompt to the LLM
|
250 |
start = time.process_time()
|
251 |
response = retrieval_chain.invoke({"input": prompt})
|
252 |
+
# print(f"Response time: {time.process_time() - start}")
|
253 |
+
st.write(f"Response time: {time.process_time() - start}")
|
254 |
|
255 |
st.write(response["answer"])
|
256 |
|
|
|
260 |
for i, doc in enumerate(response["context"]):
|
261 |
# print(doc)
|
262 |
# st.write(f"Source Document # {i+1} : {doc.metadata['source'].split('/')[-1]}")
|
263 |
+
print(doc)
|
264 |
+
st.write(f"Source Document # {i+1} : {doc.metadata['source'].split('/')[-1]}")
|
265 |
+
|
266 |
+
|
267 |
st.write(doc.page_content)
|
268 |
st.write("--------------------------------")
|
269 |
|