[Bugfix] fix chat pdf streamlit example (#1108)
Co-authored-by: Deven Patel <deven298@yahoo.com>
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user