瀏覽代碼

fix streamlit nested button state bug for clinical AI eval

lanfr144 4 天之前
父節點
當前提交
bf72dab527
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      app.py

+ 4 - 1
app.py

@@ -451,7 +451,10 @@ with tab_explore:
     idx = opts.index(user_lim_val)
     limit_rc = cols[4].selectbox("Limit Results", opts, index=idx)
     
-    if st.button("Search Database") and sq and conn_reader:
+    if st.button("Search Database"):
+        st.session_state["trigger_search"] = True
+        
+    if st.session_state.get("trigger_search", False) and sq and conn_reader:
         notifier.send_alert(f"Medical DB Search Executed: {sq}")
         with st.spinner("Processing massive clinical query..."):
             try: