Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ import threading
|
|
13 |
# <<<< HUGINFACE PATCH: WARMUP IMPORTS START >>>>
|
14 |
from typing import List
|
15 |
from huggingface_hub import snapshot_download
|
16 |
-
|
17 |
# <<<< HUGINFACE PATCH: WARMUP IMPORTS END >>>>
|
18 |
import subprocess
|
19 |
|
@@ -505,7 +505,7 @@ async def warmup_start(payload: Optional[Dict[str, Any]] = Body(None)):
|
|
505 |
@app.get("/warmup/status", tags=["warmup"])
|
506 |
def warmup_status():
|
507 |
""" Retourne l'état courant du warm-up (progression, logs, etc.). """
|
508 |
-
|
509 |
data = deepcopy(warmup_state)
|
510 |
# Identifiant d'instance pour aider à diagnostiquer les bascules de réplique
|
511 |
data["instance_id"] = INSTANCE_ID
|
@@ -519,6 +519,7 @@ def warmup_status():
|
|
519 |
|
520 |
|
521 |
|
|
|
522 |
data["ts"] = time.time()
|
523 |
return data
|
524 |
|
|
|
13 |
# <<<< HUGINFACE PATCH: WARMUP IMPORTS START >>>>
|
14 |
from typing import List
|
15 |
from huggingface_hub import snapshot_download
|
16 |
+
|
17 |
# <<<< HUGINFACE PATCH: WARMUP IMPORTS END >>>>
|
18 |
import subprocess
|
19 |
|
|
|
505 |
@app.get("/warmup/status", tags=["warmup"])
|
506 |
def warmup_status():
|
507 |
""" Retourne l'état courant du warm-up (progression, logs, etc.). """
|
508 |
+
with warmup_lock:
|
509 |
data = deepcopy(warmup_state)
|
510 |
# Identifiant d'instance pour aider à diagnostiquer les bascules de réplique
|
511 |
data["instance_id"] = INSTANCE_ID
|
|
|
519 |
|
520 |
|
521 |
|
522 |
+
|
523 |
data["ts"] = time.time()
|
524 |
return data
|
525 |
|