Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
419e526
1
Parent(s):
5df1f2d
Update model logging to use hf_filename instead of model_name
Browse files- api/management.py +4 -4
api/management.py
CHANGED
@@ -21,10 +21,10 @@ async def load_single_model(model_db_id: Any):
|
|
21 |
if not model_data:
|
22 |
raise HTTPException(status_code=404, detail=f"Model ID {model_db_id} not found in database.")
|
23 |
|
24 |
-
logger.info(f"Loading model {model_db_id} ({model_data['
|
25 |
success = await _load_single_model_pipeline(model_data)
|
26 |
if success:
|
27 |
-
logger.info(f"Model {model_db_id} ({model_data['
|
28 |
return {"message": f"Model {model_db_id} loaded successfully."}
|
29 |
else:
|
30 |
# L'erreur spécifique devrait être loggée dans _load_single_model_pipeline
|
@@ -50,7 +50,7 @@ async def update_single_model(model_db_id: Any):
|
|
50 |
# Devrait être peu probable si le modèle est chargé, mais vérification par sécurité
|
51 |
raise HTTPException(status_code=404, detail=f"Model ID {model_db_id} not found in database despite being loaded.")
|
52 |
|
53 |
-
logger.info(f"Updating (reloading) model {model_db_id} ({model_data['
|
54 |
|
55 |
# Supprimer l'ancien modèle de la mémoire
|
56 |
if model_db_id in model_pipelines:
|
@@ -61,7 +61,7 @@ async def update_single_model(model_db_id: Any):
|
|
61 |
success = await _load_single_model_pipeline(model_data, force_download=True) # Forcer le re-téléchargement
|
62 |
|
63 |
if success:
|
64 |
-
logger.info(f"Model {model_db_id} ({model_data['
|
65 |
return {"message": f"Model {model_db_id} updated successfully."}
|
66 |
else:
|
67 |
# Si le rechargement échoue, le modèle n'est plus en mémoire
|
|
|
21 |
if not model_data:
|
22 |
raise HTTPException(status_code=404, detail=f"Model ID {model_db_id} not found in database.")
|
23 |
|
24 |
+
logger.info(f"Loading model {model_db_id} ({model_data['hf_filename']}) on demand...")
|
25 |
success = await _load_single_model_pipeline(model_data)
|
26 |
if success:
|
27 |
+
logger.info(f"Model {model_db_id} ({model_data['hf_filename']}) loaded successfully.")
|
28 |
return {"message": f"Model {model_db_id} loaded successfully."}
|
29 |
else:
|
30 |
# L'erreur spécifique devrait être loggée dans _load_single_model_pipeline
|
|
|
50 |
# Devrait être peu probable si le modèle est chargé, mais vérification par sécurité
|
51 |
raise HTTPException(status_code=404, detail=f"Model ID {model_db_id} not found in database despite being loaded.")
|
52 |
|
53 |
+
logger.info(f"Updating (reloading) model {model_db_id} ({model_data['hf_filename']})...")
|
54 |
|
55 |
# Supprimer l'ancien modèle de la mémoire
|
56 |
if model_db_id in model_pipelines:
|
|
|
61 |
success = await _load_single_model_pipeline(model_data, force_download=True) # Forcer le re-téléchargement
|
62 |
|
63 |
if success:
|
64 |
+
logger.info(f"Model {model_db_id} ({model_data['hf_filename']}) updated successfully.")
|
65 |
return {"message": f"Model {model_db_id} updated successfully."}
|
66 |
else:
|
67 |
# Si le rechargement échoue, le modèle n'est plus en mémoire
|