yashvardhanshah commited on
Commit
718fd67
·
1 Parent(s): 582b806

debug health check

Browse files
Files changed (1) hide show
  1. app/frontend/pages/1_Diagnosis.py +7 -12
app/frontend/pages/1_Diagnosis.py CHANGED
@@ -125,18 +125,13 @@ with right:
125
  if uploaded and analyze:
126
  with st.spinner("Analyzing... running inference on 448×448 input..."):
127
  try:
128
- # Wait for model to be ready
129
- for i in range(6):
130
- try:
131
- health = requests.get(f"{API_URL}/health", timeout=5)
132
- if health.json().get("model_loaded"):
133
- break
134
- except:
135
- pass
136
- if i < 5:
137
- st.toast(f"Model warming up... ({i+1}/6)")
138
- import time; time.sleep(5)
139
-
140
  uploaded.seek(0)
141
  files = {"file": (uploaded.name, uploaded, uploaded.type)}
142
  resp = requests.post(f"{API_URL}/predict", files=files, timeout=60)
 
125
  if uploaded and analyze:
126
  with st.spinner("Analyzing... running inference on 448×448 input..."):
127
  try:
128
+ # Debug: check health
129
+ try:
130
+ health = requests.get(f"{API_URL}/health", timeout=5)
131
+ st.write(f"DEBUG: {health.json()}")
132
+ except Exception as ex:
133
+ st.write(f"DEBUG ERROR: {ex}")
134
+
 
 
 
 
 
135
  uploaded.seek(0)
136
  files = {"file": (uploaded.name, uploaded, uploaded.type)}
137
  resp = requests.post(f"{API_URL}/predict", files=files, timeout=60)