Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -121,13 +121,18 @@ CUSTOM_CSS = """
|
|
| 121 |
border-radius: 12px !important;
|
| 122 |
padding: 2rem !important;
|
| 123 |
margin: 0.5rem !important;
|
| 124 |
-
color: #081423 !important;
|
| 125 |
}
|
| 126 |
|
| 127 |
.result-card h3 {
|
| 128 |
font-size: 1.5rem !important;
|
| 129 |
margin-bottom: 1rem !important;
|
| 130 |
-
color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
}
|
| 132 |
|
| 133 |
/* Calculator section */
|
|
@@ -156,20 +161,44 @@ CUSTOM_CSS = """
|
|
| 156 |
opacity: 1 !important;
|
| 157 |
}
|
| 158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
/* Recommendation panel */
|
| 160 |
.recommendation-panel {
|
| 161 |
background-color: #FFC700 !important;
|
| 162 |
border-radius: 12px !important;
|
| 163 |
padding: 2rem !important;
|
| 164 |
margin-top: 1.5rem !important;
|
| 165 |
-
color: #081423 !important;
|
| 166 |
}
|
| 167 |
|
| 168 |
.recommendation-panel h3 {
|
|
|
|
| 169 |
font-size: 1.5rem !important;
|
|
|
|
| 170 |
margin-bottom: 1rem !important;
|
| 171 |
}
|
| 172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
/* Calculate button */
|
| 174 |
.calculate-button {
|
| 175 |
background-color: #FFC700 !important;
|
|
@@ -180,6 +209,12 @@ CUSTOM_CSS = """
|
|
| 180 |
margin-top: 2rem !important;
|
| 181 |
font-size: 1.1rem !important;
|
| 182 |
width: auto !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
}
|
| 184 |
"""
|
| 185 |
|
|
@@ -391,11 +426,16 @@ def create_app():
|
|
| 391 |
|
| 392 |
return build_text, preamble_text
|
| 393 |
|
| 394 |
-
def update_api_calls_visibility(existing_ai, deployment_type):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 395 |
should_show = (
|
| 396 |
deployment_type != "On-Premises" and
|
| 397 |
(existing_ai == "Yes, we have existing AI applications" or
|
| 398 |
-
|
| 399 |
)
|
| 400 |
return gr.update(visible=should_show)
|
| 401 |
|
|
@@ -410,10 +450,11 @@ def create_app():
|
|
| 410 |
if input_elem in [deployment_type, existing_ai]:
|
| 411 |
input_elem.change(
|
| 412 |
fn=update_api_calls_visibility,
|
| 413 |
-
inputs=[existing_ai, deployment_type],
|
| 414 |
outputs=[estimated_api_calls]
|
| 415 |
)
|
| 416 |
|
|
|
|
| 417 |
calculate_button.click(
|
| 418 |
fn=update_results,
|
| 419 |
inputs=[
|
|
|
|
| 121 |
border-radius: 12px !important;
|
| 122 |
padding: 2rem !important;
|
| 123 |
margin: 0.5rem !important;
|
|
|
|
| 124 |
}
|
| 125 |
|
| 126 |
.result-card h3 {
|
| 127 |
font-size: 1.5rem !important;
|
| 128 |
margin-bottom: 1rem !important;
|
| 129 |
+
color: #081423 !important;
|
| 130 |
+
font-weight: 600 !important;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
.result-card p, .result-card strong {
|
| 134 |
+
color: #081423 !important;
|
| 135 |
+
font-size: 1.1rem !important;
|
| 136 |
}
|
| 137 |
|
| 138 |
/* Calculator section */
|
|
|
|
| 161 |
opacity: 1 !important;
|
| 162 |
}
|
| 163 |
|
| 164 |
+
/* Sliders and inputs in calculator */
|
| 165 |
+
.calculator-tabs label span:first-child {
|
| 166 |
+
color: #ECF0F6 !important;
|
| 167 |
+
font-weight: 500 !important;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
.calculator-tabs .info-text {
|
| 171 |
+
color: #ECF0F6 !important;
|
| 172 |
+
opacity: 0.8 !important;
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
/* Recommendation panel */
|
| 176 |
.recommendation-panel {
|
| 177 |
background-color: #FFC700 !important;
|
| 178 |
border-radius: 12px !important;
|
| 179 |
padding: 2rem !important;
|
| 180 |
margin-top: 1.5rem !important;
|
|
|
|
| 181 |
}
|
| 182 |
|
| 183 |
.recommendation-panel h3 {
|
| 184 |
+
color: #081423 !important;
|
| 185 |
font-size: 1.5rem !important;
|
| 186 |
+
font-weight: 600 !important;
|
| 187 |
margin-bottom: 1rem !important;
|
| 188 |
}
|
| 189 |
|
| 190 |
+
.recommendation-panel ul {
|
| 191 |
+
list-style-type: none !important;
|
| 192 |
+
padding-left: 0 !important;
|
| 193 |
+
margin: 1rem 0 !important;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
.recommendation-panel li {
|
| 197 |
+
color: #081423 !important;
|
| 198 |
+
margin-bottom: 0.75rem !important;
|
| 199 |
+
font-size: 1.1rem !important;
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
/* Calculate button */
|
| 203 |
.calculate-button {
|
| 204 |
background-color: #FFC700 !important;
|
|
|
|
| 209 |
margin-top: 2rem !important;
|
| 210 |
font-size: 1.1rem !important;
|
| 211 |
width: auto !important;
|
| 212 |
+
transition: all 0.2s !important;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
.calculate-button:hover {
|
| 216 |
+
transform: translateY(-2px) !important;
|
| 217 |
+
box-shadow: 0 4px 12px rgba(255, 199, 0, 0.3) !important;
|
| 218 |
}
|
| 219 |
"""
|
| 220 |
|
|
|
|
| 426 |
|
| 427 |
return build_text, preamble_text
|
| 428 |
|
| 429 |
+
def update_api_calls_visibility(existing_ai, deployment_type, budget):
|
| 430 |
+
try:
|
| 431 |
+
budget_value = float(budget) if budget is not None else 0
|
| 432 |
+
except (ValueError, TypeError):
|
| 433 |
+
budget_value = 0
|
| 434 |
+
|
| 435 |
should_show = (
|
| 436 |
deployment_type != "On-Premises" and
|
| 437 |
(existing_ai == "Yes, we have existing AI applications" or
|
| 438 |
+
budget_value <= 5000)
|
| 439 |
)
|
| 440 |
return gr.update(visible=should_show)
|
| 441 |
|
|
|
|
| 450 |
if input_elem in [deployment_type, existing_ai]:
|
| 451 |
input_elem.change(
|
| 452 |
fn=update_api_calls_visibility,
|
| 453 |
+
inputs=[existing_ai, deployment_type, monthly_budget],
|
| 454 |
outputs=[estimated_api_calls]
|
| 455 |
)
|
| 456 |
|
| 457 |
+
# Connect calculate button
|
| 458 |
calculate_button.click(
|
| 459 |
fn=update_results,
|
| 460 |
inputs=[
|