Spaces:
Build error
Build error
Commit ·
e09dc7e
1
Parent(s): a3ab209
updated pom file
Browse files
app.py
CHANGED
|
@@ -107,26 +107,6 @@ elif genre==radioButtonList[4]:
|
|
| 107 |
isCustomURL = genre==radioButtonList[4]
|
| 108 |
urlInput = st.text_input('Enter your own URL', '', placeholder="Type your URL here (e.g. https://abc.xyz/investor/)", disabled=not isCustomURL)
|
| 109 |
|
| 110 |
-
# Add some designs to the text input
|
| 111 |
-
st.markdown("""
|
| 112 |
-
<style>
|
| 113 |
-
.stTextInput {
|
| 114 |
-
padding: 10px;
|
| 115 |
-
border-radius: 5px;
|
| 116 |
-
background-color: #f5f5f5;
|
| 117 |
-
}
|
| 118 |
-
|
| 119 |
-
.stTextInput input {
|
| 120 |
-
font-size: 16px;
|
| 121 |
-
color: #333;
|
| 122 |
-
}
|
| 123 |
-
|
| 124 |
-
.stTextInput:focus {
|
| 125 |
-
outline: none;
|
| 126 |
-
}
|
| 127 |
-
</style>
|
| 128 |
-
""", unsafe_allow_html=True)
|
| 129 |
-
|
| 130 |
isCustomPDF = genre==radioButtonList[1] or genre==radioButtonList[2]
|
| 131 |
uploaded_file = st.file_uploader(f"Upload your own {pdfCSVURLText} here", type=pdfCSVURLText.lower(), disabled=not isCustomPDF)
|
| 132 |
uploadedFilename = ""
|
|
@@ -196,19 +176,3 @@ if st.button(chatWithPDFButton, disabled=not enableChatBox and not chatTextStr):
|
|
| 196 |
input_key="question")
|
| 197 |
answer = chain.run(chatTextStr)
|
| 198 |
st.write(answer)
|
| 199 |
-
|
| 200 |
-
# Define the scroll operation as a function and pass in something unique for each
|
| 201 |
-
# page load that it needs to re-evaluate where "bottom" is
|
| 202 |
-
js = f"""
|
| 203 |
-
<script>
|
| 204 |
-
function scroll(dummy_var_to_force_repeat_execution){{
|
| 205 |
-
var textAreas = parent.document.querySelectorAll('section.main');
|
| 206 |
-
for (let index = 0; index < textAreas.length; index++) {{
|
| 207 |
-
textAreas[index].style.color = 'red'
|
| 208 |
-
textAreas[index].scrollTop = textAreas[index].scrollHeight;
|
| 209 |
-
}}
|
| 210 |
-
}}
|
| 211 |
-
scroll({len(st.session_state.chat)})
|
| 212 |
-
</script>
|
| 213 |
-
"""
|
| 214 |
-
st.components.v1.html(js)
|
|
|
|
| 107 |
isCustomURL = genre==radioButtonList[4]
|
| 108 |
urlInput = st.text_input('Enter your own URL', '', placeholder="Type your URL here (e.g. https://abc.xyz/investor/)", disabled=not isCustomURL)
|
| 109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
isCustomPDF = genre==radioButtonList[1] or genre==radioButtonList[2]
|
| 111 |
uploaded_file = st.file_uploader(f"Upload your own {pdfCSVURLText} here", type=pdfCSVURLText.lower(), disabled=not isCustomPDF)
|
| 112 |
uploadedFilename = ""
|
|
|
|
| 176 |
input_key="question")
|
| 177 |
answer = chain.run(chatTextStr)
|
| 178 |
st.write(answer)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|