Spaces:
Sleeping
Sleeping
Commit
·
a7ccdf0
1
Parent(s):
8d79839
message
Browse files
app.py
CHANGED
|
@@ -28,7 +28,6 @@ elif genre==radioButtonList[4]:
|
|
| 28 |
|
| 29 |
isCustomURL = genre==radioButtonList[4]
|
| 30 |
urlInput = st.text_input('Enter your own URL', '', placeholder="Type your URL here (e.g. https://tinyurl.com/f85wujsj)", disabled=not isCustomURL)
|
| 31 |
-
isValidURL = validators.url(urlInput)
|
| 32 |
|
| 33 |
isCustomPDF = genre==radioButtonList[1] or genre==radioButtonList[2]
|
| 34 |
uploaded_file = st.file_uploader(f"Upload your own {pdfCSVURLText} here", type=pdfCSVURLText.lower(), disabled=not isCustomPDF)
|
|
@@ -53,8 +52,8 @@ elif genre==radioButtonList[4]:
|
|
| 53 |
chatTextStr = st.text_input(f'Ask me anything about this {pdfCSVURLText}', '', placeholder="Type your question here (e.g. what was the most sold item?)", disabled=not enableChatBox)
|
| 54 |
chatWithPDFButton = "CLICK HERE TO START CHATTING"
|
| 55 |
if st.button(chatWithPDFButton, disabled=not enableChatBox and not chatTextStr): # Button Cliked
|
| 56 |
-
if genre==radioButtonList[4] and not
|
| 57 |
-
st.write(
|
| 58 |
print("Successfully processed files")
|
| 59 |
# else:
|
| 60 |
# pass
|
|
|
|
| 28 |
|
| 29 |
isCustomURL = genre==radioButtonList[4]
|
| 30 |
urlInput = st.text_input('Enter your own URL', '', placeholder="Type your URL here (e.g. https://tinyurl.com/f85wujsj)", disabled=not isCustomURL)
|
|
|
|
| 31 |
|
| 32 |
isCustomPDF = genre==radioButtonList[1] or genre==radioButtonList[2]
|
| 33 |
uploaded_file = st.file_uploader(f"Upload your own {pdfCSVURLText} here", type=pdfCSVURLText.lower(), disabled=not isCustomPDF)
|
|
|
|
| 52 |
chatTextStr = st.text_input(f'Ask me anything about this {pdfCSVURLText}', '', placeholder="Type your question here (e.g. what was the most sold item?)", disabled=not enableChatBox)
|
| 53 |
chatWithPDFButton = "CLICK HERE TO START CHATTING"
|
| 54 |
if st.button(chatWithPDFButton, disabled=not enableChatBox and not chatTextStr): # Button Cliked
|
| 55 |
+
if genre==radioButtonList[4] and not validators.url(urlInput):
|
| 56 |
+
st.write('Invalid ULR. Please enter a valid URL.')
|
| 57 |
print("Successfully processed files")
|
| 58 |
# else:
|
| 59 |
# pass
|