[Bugfix] fix chat pdf streamlit example (#1108)

Co-authored-by: Deven Patel <deven298@yahoo.com>
This commit is contained in:
Deven Patel
2024-01-03 13:46:44 +05:30
committed by GitHub
parent f5e3410e9a
commit 1976d38b25
3 changed files with 2 additions and 2 deletions

View File

@@ -146,7 +146,7 @@ if prompt := st.chat_input("Ask me anything!"):
full_response += "\n\n**Sources**:\n" full_response += "\n\n**Sources**:\n"
sources = [] sources = []
for i, citation in enumerate(citations): for i, citation in enumerate(citations):
source = citation[1] source = citation[1]["url"]
pattern = re.compile(r"([^/]+)\.[^\.]+\.pdf$") pattern = re.compile(r"([^/]+)\.[^\.]+\.pdf$")
match = pattern.search(source) match = pattern.search(source)
if match: if match:

View File

@@ -7,7 +7,7 @@ while True:
user_input = input("Enter your question (type 'exit' to quit): ") user_input = input("Enter your question (type 'exit' to quit): ")
# Break the loop if the user types 'exit' # Break the loop if the user types 'exit'
if user_input.lower() == 'exit': if user_input.lower() == "exit":
break break
# Process the input and provide a response # Process the input and provide a response