Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -98,8 +98,7 @@ def chatbot_response(history, user_input, text_input=None, file_input=None):
|
|
| 98 |
# Append the question and answer to the chat history
|
| 99 |
history.append([user_input, answer])
|
| 100 |
|
| 101 |
-
return history,
|
| 102 |
-
|
| 103 |
|
| 104 |
# Streamlit App Layout
|
| 105 |
st.set_page_config(page_title="News Classifier", page_icon="📰")
|
|
@@ -139,7 +138,7 @@ history = []
|
|
| 139 |
user_input = st.text_input("Ask about news classification or topics", placeholder="Type a message...")
|
| 140 |
source_toggle = st.radio("Select Context Source", ["Single Article", "Bulk Classification"])
|
| 141 |
if st.button("✉ Send"):
|
| 142 |
-
history, bot_response = chatbot_response(history, user_input, source_toggle)
|
| 143 |
st.write("*Chatbot Response:*")
|
| 144 |
for q, a in history:
|
| 145 |
st.write(f"*Q:* {q}")
|
|
|
|
| 98 |
# Append the question and answer to the chat history
|
| 99 |
history.append([user_input, answer])
|
| 100 |
|
| 101 |
+
return history, answer
|
|
|
|
| 102 |
|
| 103 |
# Streamlit App Layout
|
| 104 |
st.set_page_config(page_title="News Classifier", page_icon="📰")
|
|
|
|
| 138 |
user_input = st.text_input("Ask about news classification or topics", placeholder="Type a message...")
|
| 139 |
source_toggle = st.radio("Select Context Source", ["Single Article", "Bulk Classification"])
|
| 140 |
if st.button("✉ Send"):
|
| 141 |
+
history, bot_response = chatbot_response(history, user_input, text_input=text_input if source_toggle == "Single Article" else None, file_input=file_input if source_toggle == "Bulk Classification" else None)
|
| 142 |
st.write("*Chatbot Response:*")
|
| 143 |
for q, a in history:
|
| 144 |
st.write(f"*Q:* {q}")
|