Spaces:
Running
Running
MekkCyber
commited on
Commit
Β·
c67e752
1
Parent(s):
70dd883
change style
Browse files
app.py
CHANGED
|
@@ -408,56 +408,60 @@ css = """
|
|
| 408 |
width: 100% !important;
|
| 409 |
}
|
| 410 |
|
| 411 |
-
/* Quantize button styling with glow effect */
|
| 412 |
-
button[variant="primary"] {
|
| 413 |
-
background: linear-gradient(135deg, #3B82F6, #10B981) !important;
|
| 414 |
-
color: white !important;
|
| 415 |
-
padding: 16px 32px !important;
|
| 416 |
-
font-size: 1.1rem !important;
|
| 417 |
-
font-weight: 700 !important;
|
| 418 |
-
border: none !important;
|
| 419 |
-
border-radius: 12px !important;
|
| 420 |
-
box-shadow: 0 0 15px rgba(59, 130, 246, 0.5) !important;
|
| 421 |
-
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
|
| 422 |
-
position: relative;
|
| 423 |
-
overflow: hidden;
|
| 424 |
-
animation: glow 1.5s ease-in-out infinite alternate;
|
| 425 |
-
}
|
| 426 |
|
| 427 |
button[variant="primary"]::before {
|
| 428 |
-
content: "
|
| 429 |
}
|
| 430 |
|
| 431 |
button[variant="primary"]:hover {
|
| 432 |
transform: translateY(-5px) scale(1.05) !important;
|
| 433 |
-
box-shadow: 0 10px 25px rgba(
|
| 434 |
}
|
| 435 |
|
| 436 |
-
@keyframes glow {
|
| 437 |
from {
|
| 438 |
-
box-shadow: 0 0 10px rgba(
|
| 439 |
}
|
| 440 |
to {
|
| 441 |
-
box-shadow: 0 0 20px rgba(
|
| 442 |
}
|
| 443 |
}
|
| 444 |
|
| 445 |
/* Login button styling */
|
| 446 |
#login-button {
|
| 447 |
-
background: linear-gradient(135deg, #
|
| 448 |
color: white !important;
|
| 449 |
font-weight: 700 !important;
|
| 450 |
border: none !important;
|
| 451 |
-
border-radius:
|
| 452 |
-
box-shadow: 0 0 15px rgba(
|
| 453 |
transition: all 0.3s ease !important;
|
| 454 |
max-width: 300px !important;
|
| 455 |
margin: 0 auto !important;
|
| 456 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 457 |
"""
|
| 458 |
|
| 459 |
# Update the main app layout
|
| 460 |
-
with gr.Blocks(
|
| 461 |
gr.Markdown(
|
| 462 |
"""
|
| 463 |
# π€ TorchAO Model Quantizer β¨
|
|
@@ -532,7 +536,7 @@ with gr.Blocks(theme=gr.themes.Ocean(), css=css) as demo:
|
|
| 532 |
|
| 533 |
with gr.Column():
|
| 534 |
quantize_button = gr.Button(
|
| 535 |
-
"π Quantize and Push to Hub",
|
| 536 |
)
|
| 537 |
output_link = gr.Markdown(
|
| 538 |
label="π Quantized Model Info", container=True, min_height=200
|
|
@@ -545,10 +549,13 @@ with gr.Blocks(theme=gr.themes.Ocean(), css=css) as demo:
|
|
| 545 |
## π Quantization Options
|
| 546 |
|
| 547 |
### Quantization Types
|
| 548 |
-
- **int4_weight_only**: 4-bit weight-only quantization
|
| 549 |
- **int8_weight_only**: 8-bit weight-only quantization
|
| 550 |
- **int8_dynamic_activation_int8_weight**: 8-bit quantization for both weights and activations
|
| 551 |
-
|
|
|
|
|
|
|
|
|
|
| 552 |
### Group Size
|
| 553 |
- Only applicable for int4_weight_only and int8_weight_only quantization
|
| 554 |
- Default value is 128
|
|
@@ -560,8 +567,8 @@ with gr.Blocks(theme=gr.themes.Ocean(), css=css) as demo:
|
|
| 560 |
3. Uploads the quantized model to your HuggingFace account
|
| 561 |
|
| 562 |
## π Memory Benefits
|
| 563 |
-
-
|
| 564 |
-
-
|
| 565 |
"""
|
| 566 |
)
|
| 567 |
# Keep existing click handler
|
|
|
|
| 408 |
width: 100% !important;
|
| 409 |
}
|
| 410 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 411 |
|
| 412 |
button[variant="primary"]::before {
|
| 413 |
+
content: "π₯ "; /* PyTorch flame icon */
|
| 414 |
}
|
| 415 |
|
| 416 |
button[variant="primary"]:hover {
|
| 417 |
transform: translateY(-5px) scale(1.05) !important;
|
| 418 |
+
box-shadow: 0 10px 25px rgba(238, 76, 44, 0.7) !important;
|
| 419 |
}
|
| 420 |
|
| 421 |
+
@keyframes pytorch-glow {
|
| 422 |
from {
|
| 423 |
+
box-shadow: 0 0 10px rgba(238, 76, 44, 0.5);
|
| 424 |
}
|
| 425 |
to {
|
| 426 |
+
box-shadow: 0 0 20px rgba(238, 76, 44, 0.8), 0 0 30px rgba(255, 156, 0, 0.5);
|
| 427 |
}
|
| 428 |
}
|
| 429 |
|
| 430 |
/* Login button styling */
|
| 431 |
#login-button {
|
| 432 |
+
background: linear-gradient(135deg, #EE4C2C, #FF9C00) !important;
|
| 433 |
color: white !important;
|
| 434 |
font-weight: 700 !important;
|
| 435 |
border: none !important;
|
| 436 |
+
border-radius: 15px !important;
|
| 437 |
+
box-shadow: 0 0 15px rgba(238, 76, 44, 0.5) !important;
|
| 438 |
transition: all 0.3s ease !important;
|
| 439 |
max-width: 300px !important;
|
| 440 |
margin: 0 auto !important;
|
| 441 |
}
|
| 442 |
+
|
| 443 |
+
.quantize-button {
|
| 444 |
+
background: linear-gradient(135deg, #EE4C2C, #FF9C00) !important;
|
| 445 |
+
color: white !important;
|
| 446 |
+
font-weight: 700 !important;
|
| 447 |
+
border: none !important;
|
| 448 |
+
border-radius: 15px !important;
|
| 449 |
+
box-shadow: 0 0 15px rgba(238, 76, 44, 0.5) !important;
|
| 450 |
+
transition: all 0.3s ease !important;
|
| 451 |
+
animation: pytorch-glow 1.5s infinite alternate !important;
|
| 452 |
+
transform-origin: center !important;
|
| 453 |
+
letter-spacing: 0.5px !important;
|
| 454 |
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
|
| 455 |
+
}
|
| 456 |
+
|
| 457 |
+
.quantize-button:hover {
|
| 458 |
+
transform: translateY(-3px) scale(1.03) !important;
|
| 459 |
+
box-shadow: 0 8px 20px rgba(238, 76, 44, 0.7) !important;
|
| 460 |
+
}
|
| 461 |
"""
|
| 462 |
|
| 463 |
# Update the main app layout
|
| 464 |
+
with gr.Blocks(css=css) as demo:
|
| 465 |
gr.Markdown(
|
| 466 |
"""
|
| 467 |
# π€ TorchAO Model Quantizer β¨
|
|
|
|
| 536 |
|
| 537 |
with gr.Column():
|
| 538 |
quantize_button = gr.Button(
|
| 539 |
+
"π Quantize and Push to Hub", elem_classes="quantize-button", elem_id="quantize-button"
|
| 540 |
)
|
| 541 |
output_link = gr.Markdown(
|
| 542 |
label="π Quantized Model Info", container=True, min_height=200
|
|
|
|
| 549 |
## π Quantization Options
|
| 550 |
|
| 551 |
### Quantization Types
|
| 552 |
+
- **int4_weight_only**: 4-bit weight-only quantization
|
| 553 |
- **int8_weight_only**: 8-bit weight-only quantization
|
| 554 |
- **int8_dynamic_activation_int8_weight**: 8-bit quantization for both weights and activations
|
| 555 |
+
- **float8_weight_only**: float8-bit weight-only quantization
|
| 556 |
+
- **float8_dynamic_activation_float8_weight**: float8-bit quantization for both weights and activations
|
| 557 |
+
- **autoquant**: automatic quantization (uses the best quantization method for the model)
|
| 558 |
+
|
| 559 |
### Group Size
|
| 560 |
- Only applicable for int4_weight_only and int8_weight_only quantization
|
| 561 |
- Default value is 128
|
|
|
|
| 567 |
3. Uploads the quantized model to your HuggingFace account
|
| 568 |
|
| 569 |
## π Memory Benefits
|
| 570 |
+
- int4 quantization can reduce model size by up to 75%
|
| 571 |
+
- int8 quantization typically reduces size by about 50%
|
| 572 |
"""
|
| 573 |
)
|
| 574 |
# Keep existing click handler
|