Spaces:
Sleeping
Sleeping
Update app_improved.py
Browse files- app_improved.py +21 -21
app_improved.py
CHANGED
|
@@ -377,6 +377,27 @@ with gr.Blocks(title="π― Telco Churn Predictor - 93% AUC Production Model", th
|
|
| 377 |
""")
|
| 378 |
|
| 379 |
# Footer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 380 |
gr.Markdown("""
|
| 381 |
---
|
| 382 |
### **π Ready for Production**
|
|
@@ -389,27 +410,6 @@ with gr.Blocks(title="π― Telco Churn Predictor - 93% AUC Production Model", th
|
|
| 389 |
**Questions?** Contact for enterprise deployment and custom integrations.
|
| 390 |
""")
|
| 391 |
|
| 392 |
-
# Event handlers
|
| 393 |
-
predict_btn.click(
|
| 394 |
-
predict_csv,
|
| 395 |
-
inputs=[csv_file],
|
| 396 |
-
outputs=[summary, output_file, plot1, plot2]
|
| 397 |
-
)
|
| 398 |
-
|
| 399 |
-
predict_btn_single.click(
|
| 400 |
-
predict_single,
|
| 401 |
-
inputs=[account_length, custserv_calls, total_day_minutes, total_day_calls,
|
| 402 |
-
total_eve_minutes, total_eve_calls, total_night_minutes, total_night_calls,
|
| 403 |
-
total_intl_minutes, total_intl_calls, number_vmail_messages,
|
| 404 |
-
international_plan, voice_mail_plan],
|
| 405 |
-
outputs=[result, gauge, importance]
|
| 406 |
-
)
|
| 407 |
-
|
| 408 |
-
sample_btn.click(
|
| 409 |
-
create_sample_csv,
|
| 410 |
-
outputs=[sample_btn]
|
| 411 |
-
)
|
| 412 |
-
|
| 413 |
if __name__ == "__main__":
|
| 414 |
# Configure for Hugging Face Spaces
|
| 415 |
demo.launch(share=True, server_name='0.0.0.0', show_error=True)
|
|
|
|
| 377 |
""")
|
| 378 |
|
| 379 |
# Footer
|
| 380 |
+
# Event handlers must be inside the Blocks context
|
| 381 |
+
predict_btn.click(
|
| 382 |
+
predict_csv,
|
| 383 |
+
inputs=[csv_file],
|
| 384 |
+
outputs=[summary, output_file, plot1, plot2]
|
| 385 |
+
)
|
| 386 |
+
|
| 387 |
+
predict_btn_single.click(
|
| 388 |
+
predict_single,
|
| 389 |
+
inputs=[account_length, custserv_calls, total_day_minutes, total_day_calls,
|
| 390 |
+
total_eve_minutes, total_eve_calls, total_night_minutes, total_night_calls,
|
| 391 |
+
total_intl_minutes, total_intl_calls, number_vmail_messages,
|
| 392 |
+
international_plan, voice_mail_plan],
|
| 393 |
+
outputs=[result, gauge, importance]
|
| 394 |
+
)
|
| 395 |
+
|
| 396 |
+
sample_btn.click(
|
| 397 |
+
create_sample_csv,
|
| 398 |
+
outputs=[sample_btn]
|
| 399 |
+
)
|
| 400 |
+
|
| 401 |
gr.Markdown("""
|
| 402 |
---
|
| 403 |
### **π Ready for Production**
|
|
|
|
| 410 |
**Questions?** Contact for enterprise deployment and custom integrations.
|
| 411 |
""")
|
| 412 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 413 |
if __name__ == "__main__":
|
| 414 |
# Configure for Hugging Face Spaces
|
| 415 |
demo.launch(share=True, server_name='0.0.0.0', show_error=True)
|