Spaces:
Sleeping
Sleeping
github-actions[bot]
commited on
Commit
·
575f46f
1
Parent(s):
cc92993
Deploy from GitHub - 2026-01-21 05:56:10
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ import numpy as np
|
|
| 22 |
import time
|
| 23 |
import os
|
| 24 |
from pathlib import Path
|
| 25 |
-
from typing import Optional, Tuple, Dict, List
|
| 26 |
from datetime import datetime
|
| 27 |
from collections import deque
|
| 28 |
import tempfile
|
|
@@ -183,7 +183,7 @@ class PerformanceTracker:
|
|
| 183 |
self.backend_times[backend].append(elapsed_ms)
|
| 184 |
self.total_inferences += 1
|
| 185 |
|
| 186 |
-
def get_stats(self) ->
|
| 187 |
"""Get performance statistics"""
|
| 188 |
if not self.inference_times:
|
| 189 |
return None
|
|
@@ -229,7 +229,7 @@ class PerformanceTracker:
|
|
| 229 |
### Speedup: {speedup:.2f}x faster with CUDA! 🚀
|
| 230 |
"""
|
| 231 |
|
| 232 |
-
def get_chart_data(self) ->
|
| 233 |
"""Get data for real-time chart"""
|
| 234 |
if not self.timestamps:
|
| 235 |
return None
|
|
@@ -2437,14 +2437,17 @@ with gr.Blocks(
|
|
| 2437 |
outputs=[train_progress, train_output]
|
| 2438 |
)
|
| 2439 |
|
|
|
|
|
|
|
|
|
|
| 2440 |
refresh_styles_btn.click(
|
| 2441 |
-
fn=
|
| 2442 |
outputs=[quick_style]
|
| 2443 |
).then(
|
| 2444 |
-
fn=
|
| 2445 |
outputs=[blend_style1]
|
| 2446 |
).then(
|
| 2447 |
-
fn=
|
| 2448 |
outputs=[blend_style2]
|
| 2449 |
)
|
| 2450 |
|
|
|
|
| 22 |
import time
|
| 23 |
import os
|
| 24 |
from pathlib import Path
|
| 25 |
+
from typing import Optional, Tuple, Dict, List, Any
|
| 26 |
from datetime import datetime
|
| 27 |
from collections import deque
|
| 28 |
import tempfile
|
|
|
|
| 183 |
self.backend_times[backend].append(elapsed_ms)
|
| 184 |
self.total_inferences += 1
|
| 185 |
|
| 186 |
+
def get_stats(self) -> Any:
|
| 187 |
"""Get performance statistics"""
|
| 188 |
if not self.inference_times:
|
| 189 |
return None
|
|
|
|
| 229 |
### Speedup: {speedup:.2f}x faster with CUDA! 🚀
|
| 230 |
"""
|
| 231 |
|
| 232 |
+
def get_chart_data(self) -> Any:
|
| 233 |
"""Get data for real-time chart"""
|
| 234 |
if not self.timestamps:
|
| 235 |
return None
|
|
|
|
| 2437 |
outputs=[train_progress, train_output]
|
| 2438 |
)
|
| 2439 |
|
| 2440 |
+
def update_style_choices():
|
| 2441 |
+
return list(STYLES.keys()) + get_custom_styles()
|
| 2442 |
+
|
| 2443 |
refresh_styles_btn.click(
|
| 2444 |
+
fn=update_style_choices,
|
| 2445 |
outputs=[quick_style]
|
| 2446 |
).then(
|
| 2447 |
+
fn=update_style_choices,
|
| 2448 |
outputs=[blend_style1]
|
| 2449 |
).then(
|
| 2450 |
+
fn=update_style_choices,
|
| 2451 |
outputs=[blend_style2]
|
| 2452 |
)
|
| 2453 |
|