mindspark121 commited on
Commit
70ae897
Β·
verified Β·
1 Parent(s): 990b877

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -130,20 +130,21 @@ if st.button("Summarize Chat"):
130
  st.subheader("Chat Summary")
131
  st.write(summary)
132
  if st.button("Detect Disorders"):
133
- if chat_history.strip():
134
- disorders = detect_disorders(chat_history.split("\n"))
135
- st.write("**Detected Disorders:**")
136
  for disorder in disorders:
137
  st.write(f"- {disorder}")
138
  else:
139
  st.error("❌ Please enter chat history.")
140
 
141
  if st.button("Get Treatment Recommendations"):
142
- if chat_history.strip():
143
- detected_disorders = detect_disorders(chat_history.split("\n"))
144
  treatments = get_treatment(detected_disorders)
145
- st.write("**Treatment Recommendations:**")
146
  for disorder, treatment in treatments.items():
147
  st.write(f"**{disorder}:** {treatment}")
148
  else:
149
  st.error("❌ Please enter chat history.")
 
 
130
  st.subheader("Chat Summary")
131
  st.write(summary)
132
  if st.button("Detect Disorders"):
133
+ if st.session_state["chat_history"]:
134
+ disorders = detect_disorders(st.session_state["chat_history"])
135
+ st.subheader("Detected Disorders:")
136
  for disorder in disorders:
137
  st.write(f"- {disorder}")
138
  else:
139
  st.error("❌ Please enter chat history.")
140
 
141
  if st.button("Get Treatment Recommendations"):
142
+ if st.session_state["chat_history"]:
143
+ detected_disorders = detect_disorders(st.session_state["chat_history"])
144
  treatments = get_treatment(detected_disorders)
145
+ st.subheader("Treatment Recommendations:")
146
  for disorder, treatment in treatments.items():
147
  st.write(f"**{disorder}:** {treatment}")
148
  else:
149
  st.error("❌ Please enter chat history.")
150
+