From 1976d38b258b8295a975f7e19bf1cb02c6a9e8a6 Mon Sep 17 00:00:00 2001 From: Deven Patel Date: Wed, 3 Jan 2024 13:46:44 +0530 Subject: [PATCH] [Bugfix] fix chat pdf streamlit example (#1108) Co-authored-by: Deven Patel --- examples/chat-pdf/.streamlit/secrets.toml | 0 examples/chat-pdf/app.py | 2 +- examples/private-ai/privateai.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 examples/chat-pdf/.streamlit/secrets.toml diff --git a/examples/chat-pdf/.streamlit/secrets.toml b/examples/chat-pdf/.streamlit/secrets.toml deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/chat-pdf/app.py b/examples/chat-pdf/app.py index 80a12e49..0b2fefae 100644 --- a/examples/chat-pdf/app.py +++ b/examples/chat-pdf/app.py @@ -146,7 +146,7 @@ if prompt := st.chat_input("Ask me anything!"): full_response += "\n\n**Sources**:\n" sources = [] for i, citation in enumerate(citations): - source = citation[1] + source = citation[1]["url"] pattern = re.compile(r"([^/]+)\.[^\.]+\.pdf$") match = pattern.search(source) if match: diff --git a/examples/private-ai/privateai.py b/examples/private-ai/privateai.py index 25c2738d..613bc2a1 100644 --- a/examples/private-ai/privateai.py +++ b/examples/private-ai/privateai.py @@ -7,7 +7,7 @@ while True: user_input = input("Enter your question (type 'exit' to quit): ") # Break the loop if the user types 'exit' - if user_input.lower() == 'exit': + if user_input.lower() == "exit": break # Process the input and provide a response