Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ import xgboost as xgb
|
|
12 |
|
13 |
warnings.filterwarnings("ignore")
|
14 |
|
15 |
-
# Load XGBoost model (
|
16 |
xgb_model = xgb.Booster()
|
17 |
xgb_model.load_model("xgb_model.json")
|
18 |
|
@@ -116,7 +116,7 @@ def chat_fn(message, history, user_state={}):
|
|
116 |
if user_state["step"] == "get_tile_size":
|
117 |
area = extract_tile_area(message, user_state["unit"])
|
118 |
if area is None:
|
119 |
-
return reply("I couldn’t understand that size. Try something like 600 x 600 or 2 x 2 or 4."), None, user_state
|
120 |
|
121 |
user_state["tile_area"] = area
|
122 |
user_state["step"] = "done"
|
@@ -164,8 +164,8 @@ def chat_fn(message, history, user_state={}):
|
|
164 |
return reply("Type 'Floor' or 'Wall' to begin a new estimate."), None, user_state
|
165 |
|
166 |
|
167 |
-
# --- Modern Gradio UI with
|
168 |
-
with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", radius_size="
|
169 |
gr.Markdown(
|
170 |
"""
|
171 |
# 🧱 <span style="color:#3B82F6">TileBot</span> – Smart Tile Estimator
|
|
|
12 |
|
13 |
warnings.filterwarnings("ignore")
|
14 |
|
15 |
+
# Load XGBoost model (from .json)
|
16 |
xgb_model = xgb.Booster()
|
17 |
xgb_model.load_model("xgb_model.json")
|
18 |
|
|
|
116 |
if user_state["step"] == "get_tile_size":
|
117 |
area = extract_tile_area(message, user_state["unit"])
|
118 |
if area is None:
|
119 |
+
return reply("I couldn’t understand that size. Try something like 600 x 600 or 2 x 2 or just 4."), None, user_state
|
120 |
|
121 |
user_state["tile_area"] = area
|
122 |
user_state["step"] = "done"
|
|
|
164 |
return reply("Type 'Floor' or 'Wall' to begin a new estimate."), None, user_state
|
165 |
|
166 |
|
167 |
+
# --- Modern Gradio UI with Soft theme ---
|
168 |
+
with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", radius_size="lg")) as demo:
|
169 |
gr.Markdown(
|
170 |
"""
|
171 |
# 🧱 <span style="color:#3B82F6">TileBot</span> – Smart Tile Estimator
|