Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -93,7 +93,7 @@ HTML_TEMPLATE = """
|
|
| 93 |
|
| 94 |
body {
|
| 95 |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 96 |
-
background: linear-gradient(135deg, #
|
| 97 |
min-height: 100vh;
|
| 98 |
padding: 20px;
|
| 99 |
display: flex;
|
|
@@ -112,7 +112,7 @@ HTML_TEMPLATE = """
|
|
| 112 |
}
|
| 113 |
|
| 114 |
.header {
|
| 115 |
-
background: linear-gradient(45deg, #
|
| 116 |
color: white;
|
| 117 |
padding: 30px;
|
| 118 |
text-align: center;
|
|
@@ -162,9 +162,9 @@ HTML_TEMPLATE = """
|
|
| 162 |
}
|
| 163 |
|
| 164 |
textarea:focus {
|
| 165 |
-
border-color: #
|
| 166 |
outline: none;
|
| 167 |
-
box-shadow: 0 0 0 3px rgba(
|
| 168 |
}
|
| 169 |
|
| 170 |
.controls {
|
|
@@ -176,7 +176,7 @@ HTML_TEMPLATE = """
|
|
| 176 |
}
|
| 177 |
|
| 178 |
.btn {
|
| 179 |
-
background: linear-gradient(45deg, #
|
| 180 |
color: white;
|
| 181 |
border: none;
|
| 182 |
padding: 15px 30px;
|
|
@@ -185,12 +185,12 @@ HTML_TEMPLATE = """
|
|
| 185 |
border-radius: 25px;
|
| 186 |
cursor: pointer;
|
| 187 |
transition: all 0.3s ease;
|
| 188 |
-
box-shadow: 0 4px 15px rgba(
|
| 189 |
}
|
| 190 |
|
| 191 |
.btn:hover {
|
| 192 |
transform: translateY(-2px);
|
| 193 |
-
box-shadow: 0 6px 20px rgba(
|
| 194 |
}
|
| 195 |
|
| 196 |
.btn:active {
|
|
@@ -245,7 +245,7 @@ HTML_TEMPLATE = """
|
|
| 245 |
display: none;
|
| 246 |
text-align: center;
|
| 247 |
padding: 20px;
|
| 248 |
-
color: #
|
| 249 |
font-size: 18px;
|
| 250 |
}
|
| 251 |
|
|
@@ -284,14 +284,14 @@ HTML_TEMPLATE = """
|
|
| 284 |
footer {
|
| 285 |
text-align: center;
|
| 286 |
padding: 20px;
|
| 287 |
-
background: #
|
| 288 |
color: #ecf0f1;
|
| 289 |
font-size: 14px;
|
| 290 |
margin-top: auto;
|
| 291 |
}
|
| 292 |
|
| 293 |
footer a {
|
| 294 |
-
color: #
|
| 295 |
text-decoration: none;
|
| 296 |
font-weight: 600;
|
| 297 |
}
|
|
@@ -319,14 +319,14 @@ HTML_TEMPLATE = """
|
|
| 319 |
<body>
|
| 320 |
<div class="container">
|
| 321 |
<div class="header">
|
| 322 |
-
<h1>
|
| 323 |
<p>Classify your customer review into relevant categories</p>
|
| 324 |
</div>
|
| 325 |
|
| 326 |
<div class="main-content">
|
| 327 |
{% if model_loaded %}
|
| 328 |
<div class="model-status loaded">
|
| 329 |
-
|
| 330 |
</div>
|
| 331 |
{% else %}
|
| 332 |
<div class="model-status error">
|
|
@@ -493,9 +493,9 @@ if __name__ == '__main__':
|
|
| 493 |
print("π Starting Fintech Review Classification App")
|
| 494 |
print("="*50)
|
| 495 |
if MODEL_LOADED:
|
| 496 |
-
print(f"
|
| 497 |
-
print(f"
|
| 498 |
-
print(f"
|
| 499 |
else:
|
| 500 |
print("β Model failed to load - app will run in demo mode")
|
| 501 |
|
|
|
|
| 93 |
|
| 94 |
body {
|
| 95 |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 96 |
+
background: linear-gradient(135deg, #6ee7b7 0%, #7dd3fc 100%);
|
| 97 |
min-height: 100vh;
|
| 98 |
padding: 20px;
|
| 99 |
display: flex;
|
|
|
|
| 112 |
}
|
| 113 |
|
| 114 |
.header {
|
| 115 |
+
background: linear-gradient(45deg, #10b981, #06b6d4);
|
| 116 |
color: white;
|
| 117 |
padding: 30px;
|
| 118 |
text-align: center;
|
|
|
|
| 162 |
}
|
| 163 |
|
| 164 |
textarea:focus {
|
| 165 |
+
border-color: #10b981;
|
| 166 |
outline: none;
|
| 167 |
+
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
|
| 168 |
}
|
| 169 |
|
| 170 |
.controls {
|
|
|
|
| 176 |
}
|
| 177 |
|
| 178 |
.btn {
|
| 179 |
+
background: linear-gradient(45deg, #10b981, #06b6d4);
|
| 180 |
color: white;
|
| 181 |
border: none;
|
| 182 |
padding: 15px 30px;
|
|
|
|
| 185 |
border-radius: 25px;
|
| 186 |
cursor: pointer;
|
| 187 |
transition: all 0.3s ease;
|
| 188 |
+
box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
|
| 189 |
}
|
| 190 |
|
| 191 |
.btn:hover {
|
| 192 |
transform: translateY(-2px);
|
| 193 |
+
box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
|
| 194 |
}
|
| 195 |
|
| 196 |
.btn:active {
|
|
|
|
| 245 |
display: none;
|
| 246 |
text-align: center;
|
| 247 |
padding: 20px;
|
| 248 |
+
color: #10b981;
|
| 249 |
font-size: 18px;
|
| 250 |
}
|
| 251 |
|
|
|
|
| 284 |
footer {
|
| 285 |
text-align: center;
|
| 286 |
padding: 20px;
|
| 287 |
+
background: #059669;
|
| 288 |
color: #ecf0f1;
|
| 289 |
font-size: 14px;
|
| 290 |
margin-top: auto;
|
| 291 |
}
|
| 292 |
|
| 293 |
footer a {
|
| 294 |
+
color: #6ee7b7;
|
| 295 |
text-decoration: none;
|
| 296 |
font-weight: 600;
|
| 297 |
}
|
|
|
|
| 319 |
<body>
|
| 320 |
<div class="container">
|
| 321 |
<div class="header">
|
| 322 |
+
<h1>Fintech Review Classifier</h1>
|
| 323 |
<p>Classify your customer review into relevant categories</p>
|
| 324 |
</div>
|
| 325 |
|
| 326 |
<div class="main-content">
|
| 327 |
{% if model_loaded %}
|
| 328 |
<div class="model-status loaded">
|
| 329 |
+
Model loaded successfully! Available categories: {{ labels|length }}
|
| 330 |
</div>
|
| 331 |
{% else %}
|
| 332 |
<div class="model-status error">
|
|
|
|
| 493 |
print("π Starting Fintech Review Classification App")
|
| 494 |
print("="*50)
|
| 495 |
if MODEL_LOADED:
|
| 496 |
+
print(f"Model loaded successfully on {DEVICE}")
|
| 497 |
+
print(f"Available categories: {len(labels)}")
|
| 498 |
+
print(f"Categories: {', '.join(labels[:5])}{'...' if len(labels) > 5 else ''}")
|
| 499 |
else:
|
| 500 |
print("β Model failed to load - app will run in demo mode")
|
| 501 |
|