Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,12 +33,20 @@ except Exception as e:
|
|
| 33 |
print(f"FAILED predict: {e}", flush=True)
|
| 34 |
sys.exit(1)
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
print("Building UI...", flush=True)
|
| 37 |
|
| 38 |
import gradio as gr
|
| 39 |
from config import QUICK_FIELDS
|
| 40 |
from train import train_model
|
| 41 |
from predict import predict, predict_single
|
|
|
|
| 42 |
|
| 43 |
DESCRIPTION = """
|
| 44 |
# House Price Predictor
|
|
@@ -96,6 +104,9 @@ with gr.Blocks(title="House Price Predictor", theme=gr.themes.Soft()) as demo:
|
|
| 96 |
single_out = gr.Markdown(value="Your estimate will appear here.")
|
| 97 |
single_btn.click(fn=predict_single, inputs=inputs, outputs=[single_out])
|
| 98 |
|
|
|
|
|
|
|
|
|
|
| 99 |
gr.Markdown("---\nBuilt with Scikit-learn, XGBoost and Gradio.")
|
| 100 |
|
| 101 |
if __name__ == "__main__":
|
|
|
|
| 33 |
print(f"FAILED predict: {e}", flush=True)
|
| 34 |
sys.exit(1)
|
| 35 |
|
| 36 |
+
try:
|
| 37 |
+
from visualize import build_analytics_tab
|
| 38 |
+
print("visualize OK", flush=True)
|
| 39 |
+
except Exception as e:
|
| 40 |
+
print(f"FAILED visualize: {e}", flush=True)
|
| 41 |
+
sys.exit(1)
|
| 42 |
+
|
| 43 |
print("Building UI...", flush=True)
|
| 44 |
|
| 45 |
import gradio as gr
|
| 46 |
from config import QUICK_FIELDS
|
| 47 |
from train import train_model
|
| 48 |
from predict import predict, predict_single
|
| 49 |
+
from visualize import build_analytics_tab
|
| 50 |
|
| 51 |
DESCRIPTION = """
|
| 52 |
# House Price Predictor
|
|
|
|
| 104 |
single_out = gr.Markdown(value="Your estimate will appear here.")
|
| 105 |
single_btn.click(fn=predict_single, inputs=inputs, outputs=[single_out])
|
| 106 |
|
| 107 |
+
# ── Tab 4: Analytics ──────────────────────────────────────────────────
|
| 108 |
+
build_analytics_tab()
|
| 109 |
+
|
| 110 |
gr.Markdown("---\nBuilt with Scikit-learn, XGBoost and Gradio.")
|
| 111 |
|
| 112 |
if __name__ == "__main__":
|