Spaces:
Sleeping
Sleeping
Fix: Remove session state modification after widget instantiation
Browse files- Removed attempt to clear question_input after submission to avoid Streamlit error
- Example questions now properly populate the input field when clicked
- Fixed 'StreamlitAPIException: cannot be modified after widget instantiation' error
app.py
CHANGED
|
@@ -431,9 +431,6 @@ def main():
|
|
| 431 |
'sources': sources
|
| 432 |
})
|
| 433 |
|
| 434 |
-
# Clear the input field after successful submission
|
| 435 |
-
st.session_state.question_input = ""
|
| 436 |
-
|
| 437 |
# Success message
|
| 438 |
st.success("✅ Answer generated successfully! Check the chat history below.")
|
| 439 |
|
|
|
|
| 431 |
'sources': sources
|
| 432 |
})
|
| 433 |
|
|
|
|
|
|
|
|
|
|
| 434 |
# Success message
|
| 435 |
st.success("✅ Answer generated successfully! Check the chat history below.")
|
| 436 |
|