Spaces:
Sleeping
Sleeping
Update classify.py
Browse files- classify.py +7 -1
classify.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
"""
|
| 2 |
-
classify.py β 3-Tier Hybrid Pipeline (V11 β MAX SPEED + SAFE MULTIPROCESSING)
|
| 3 |
"""
|
| 4 |
from __future__ import annotations
|
| 5 |
import os
|
|
@@ -30,6 +30,12 @@ def _make_result(label: str, tier: str, confidence, latency_ms: float) -> dict:
|
|
| 30 |
def cached_llm_call(log_msg: str) -> str:
|
| 31 |
return classify_with_llm(log_msg)
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
def classify_logs(logs: list[tuple[str, str]]) -> list[dict]:
|
| 34 |
"""Processes a chunk of logs."""
|
| 35 |
n = len(logs)
|
|
|
|
| 1 |
"""
|
| 2 |
+
classify.py β 3-Tier Hybrid Pipeline (V11 β MAX SPEED + SAFE MULTIPROCESSING + UI FIX)
|
| 3 |
"""
|
| 4 |
from __future__ import annotations
|
| 5 |
import os
|
|
|
|
| 30 |
def cached_llm_call(log_msg: str) -> str:
|
| 31 |
return classify_with_llm(log_msg)
|
| 32 |
|
| 33 |
+
# ββ Single log (backward-compatible for UI) βββββββββββββββββββββββββββββββββ
|
| 34 |
+
def classify_log(source: str, log_msg: str) -> dict:
|
| 35 |
+
"""Used by Gradio real-time analyzer tab."""
|
| 36 |
+
results = classify_logs([(source, log_msg)])
|
| 37 |
+
return results[0]
|
| 38 |
+
|
| 39 |
def classify_logs(logs: list[tuple[str, str]]) -> list[dict]:
|
| 40 |
"""Processes a chunk of logs."""
|
| 41 |
n = len(logs)
|