Muhammadidrees commited on
Commit
9885f37
Β·
verified Β·
1 Parent(s): 84e8f17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -130,7 +130,7 @@ def analyze(
130
  prompt,
131
  max_new_tokens=3000,
132
  do_sample=False, # deterministic
133
- temperature=0.0, # no randomness
134
  top_p=1.0, # cover all tokens
135
  repetition_penalty=1.1, # reduce repetition
136
  return_full_text=False
@@ -196,13 +196,21 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
196
  gr.Markdown("### πŸ“Š Tabular & AI Insights")
197
  right_output = gr.Markdown(value="Tabular mapping and enhanced insights will appear here.")
198
 
 
199
  analyze_btn.click(
200
  fn=analyze,
201
  inputs=[albumin, creatinine, glucose, crp, mcv, rdw, alp, wbc, lymph, age, gender, height, weight],
202
  outputs=[left_output, right_output]
203
  )
204
 
205
-
206
- # Launch (HF Spaces expects this pattern)
 
 
207
  if __name__ == "__main__":
208
- demo.launch(server_name="0.0.0.0", server_port=int(os.environ.get("PORT", 7860)))
 
 
 
 
 
 
130
  prompt,
131
  max_new_tokens=3000,
132
  do_sample=False, # deterministic
133
+ temperature=0.01, # no randomness
134
  top_p=1.0, # cover all tokens
135
  repetition_penalty=1.1, # reduce repetition
136
  return_full_text=False
 
196
  gr.Markdown("### πŸ“Š Tabular & AI Insights")
197
  right_output = gr.Markdown(value="Tabular mapping and enhanced insights will appear here.")
198
 
199
+ # Connect button to function
200
  analyze_btn.click(
201
  fn=analyze,
202
  inputs=[albumin, creatinine, glucose, crp, mcv, rdw, alp, wbc, lymph, age, gender, height, weight],
203
  outputs=[left_output, right_output]
204
  )
205
 
206
+
207
+ # -------------------------
208
+ # Launch app with error visibility
209
+ # -------------------------
210
  if __name__ == "__main__":
211
+ demo.launch(
212
+ server_name="0.0.0.0",
213
+ server_port=int(os.environ.get("PORT", 7860)),
214
+ show_error=True, # πŸ‘ˆ enables full error trace in logs
215
+ share=False # keep private; set True only for public links
216
+ )