Spaces:
Running on Zero
Running on Zero
Enable ZeroGPU (A10G) and increase batch size
Browse files
README.md
CHANGED
|
@@ -8,6 +8,7 @@ sdk_version: "4.44.0"
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
|
|
|
| 11 |
short_description: Find anomalies in logs using AI. Paste logs, get insights.
|
| 12 |
tags:
|
| 13 |
- log-analysis
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
| 11 |
+
hardware: zero-a10g
|
| 12 |
short_description: Find anomalies in logs using AI. Paste logs, get insights.
|
| 13 |
tags:
|
| 14 |
- log-analysis
|
app.py
CHANGED
|
@@ -89,6 +89,8 @@ def _analyze_logs_impl(
|
|
| 89 |
progress(0.1, desc="Configuring analyzer...")
|
| 90 |
|
| 91 |
device = get_device()
|
|
|
|
|
|
|
| 92 |
|
| 93 |
if mode == "Percentile":
|
| 94 |
config = AnalysisConfig(
|
|
@@ -96,6 +98,7 @@ def _analyze_logs_impl(
|
|
| 96 |
k_neighbors=k_neighbors,
|
| 97 |
anomaly_percentile=anomaly_percentile,
|
| 98 |
device=device,
|
|
|
|
| 99 |
)
|
| 100 |
else:
|
| 101 |
config = AnalysisConfig(
|
|
@@ -104,6 +107,7 @@ def _analyze_logs_impl(
|
|
| 104 |
anomaly_range_min=range_min,
|
| 105 |
anomaly_range_max=range_max,
|
| 106 |
device=device,
|
|
|
|
| 107 |
)
|
| 108 |
|
| 109 |
progress(0.15, desc="Loading embedding model...")
|
|
|
|
| 89 |
progress(0.1, desc="Configuring analyzer...")
|
| 90 |
|
| 91 |
device = get_device()
|
| 92 |
+
# Use larger batch size on GPU for better throughput
|
| 93 |
+
batch_size = 128 if device == "cuda" else 32
|
| 94 |
|
| 95 |
if mode == "Percentile":
|
| 96 |
config = AnalysisConfig(
|
|
|
|
| 98 |
k_neighbors=k_neighbors,
|
| 99 |
anomaly_percentile=anomaly_percentile,
|
| 100 |
device=device,
|
| 101 |
+
batch_size=batch_size,
|
| 102 |
)
|
| 103 |
else:
|
| 104 |
config = AnalysisConfig(
|
|
|
|
| 107 |
anomaly_range_min=range_min,
|
| 108 |
anomaly_range_max=range_max,
|
| 109 |
device=device,
|
| 110 |
+
batch_size=batch_size,
|
| 111 |
)
|
| 112 |
|
| 113 |
progress(0.15, desc="Loading embedding model...")
|