Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,12 +16,18 @@ import sys
|
|
| 16 |
sys.path.append(os.path.join(os.path.dirname(__file__), "core"))
|
| 17 |
|
| 18 |
# === Импорт логирования + метрик + FailSafe ===
|
| 19 |
-
from alert_core import log_alert
|
| 20 |
from metrics_core import save_metrics
|
| 21 |
from alerters import ConsoleAlerter, FileAlerter
|
| 22 |
from alert_manager import AlertManager
|
| 23 |
from failsafe_core import failsafe
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
# === Настройка моделей для логики ===
|
| 27 |
PRIMARY_MODEL = "microsoft/phi-3-mini-instruct"
|
|
@@ -417,3 +423,4 @@ if __name__ == "__main__":
|
|
| 417 |
|
| 418 |
threading.Thread(target=run_gradio, daemon=True).start()
|
| 419 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
|
|
| 16 |
sys.path.append(os.path.join(os.path.dirname(__file__), "core"))
|
| 17 |
|
| 18 |
# === Импорт логирования + метрик + FailSafe ===
|
| 19 |
+
# from alert_core import log_alert
|
| 20 |
from metrics_core import save_metrics
|
| 21 |
from alerters import ConsoleAlerter, FileAlerter
|
| 22 |
from alert_manager import AlertManager
|
| 23 |
from failsafe_core import failsafe
|
| 24 |
|
| 25 |
+
# Safe import for alert_core
|
| 26 |
+
try:
|
| 27 |
+
from alert_core import log_alert
|
| 28 |
+
except ModuleNotFoundError:
|
| 29 |
+
def log_alert(msg: str):
|
| 30 |
+
print(f"[⚠️ ALERT] {msg} (alert_core not found — using fallback)")
|
| 31 |
|
| 32 |
# === Настройка моделей для логики ===
|
| 33 |
PRIMARY_MODEL = "microsoft/phi-3-mini-instruct"
|
|
|
|
| 423 |
|
| 424 |
threading.Thread(target=run_gradio, daemon=True).start()
|
| 425 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 426 |
+
|