Spaces:
Sleeping
Sleeping
ming commited on
Commit ·
e186c67
1
Parent(s): df1ab37
Add model ID logging to HF streaming service
Browse files- Log model ID during initialization
- Log model ID when processing text
- Log model ID when summarization completes
- Improves debugging and model tracking
app/services/hf_streaming_summarizer.py
CHANGED
|
@@ -59,6 +59,7 @@ class HFStreamingSummarizer:
|
|
| 59 |
self.model.eval()
|
| 60 |
|
| 61 |
logger.info("✅ HuggingFace model initialized successfully")
|
|
|
|
| 62 |
logger.info(f" Model device: {next(self.model.parameters()).device}")
|
| 63 |
logger.info(f" Torch dtype: {next(self.model.parameters()).dtype}")
|
| 64 |
|
|
@@ -165,7 +166,7 @@ class HFStreamingSummarizer:
|
|
| 165 |
start_time = time.time()
|
| 166 |
text_length = len(text)
|
| 167 |
|
| 168 |
-
logger.info(f"Processing text of {text_length} chars with HuggingFace model")
|
| 169 |
|
| 170 |
try:
|
| 171 |
# Use provided parameters or defaults
|
|
@@ -323,7 +324,7 @@ class HFStreamingSummarizer:
|
|
| 323 |
"latency_ms": round(latency_ms, 2),
|
| 324 |
}
|
| 325 |
|
| 326 |
-
logger.info(f"✅ HuggingFace summarization completed in {latency_ms:.2f}ms")
|
| 327 |
|
| 328 |
except Exception:
|
| 329 |
# Capture full traceback to aid debugging (the message may be empty otherwise)
|
|
|
|
| 59 |
self.model.eval()
|
| 60 |
|
| 61 |
logger.info("✅ HuggingFace model initialized successfully")
|
| 62 |
+
logger.info(f" Model ID: {settings.hf_model_id}")
|
| 63 |
logger.info(f" Model device: {next(self.model.parameters()).device}")
|
| 64 |
logger.info(f" Torch dtype: {next(self.model.parameters()).dtype}")
|
| 65 |
|
|
|
|
| 166 |
start_time = time.time()
|
| 167 |
text_length = len(text)
|
| 168 |
|
| 169 |
+
logger.info(f"Processing text of {text_length} chars with HuggingFace model: {settings.hf_model_id}")
|
| 170 |
|
| 171 |
try:
|
| 172 |
# Use provided parameters or defaults
|
|
|
|
| 324 |
"latency_ms": round(latency_ms, 2),
|
| 325 |
}
|
| 326 |
|
| 327 |
+
logger.info(f"✅ HuggingFace summarization completed in {latency_ms:.2f}ms using model: {settings.hf_model_id}")
|
| 328 |
|
| 329 |
except Exception:
|
| 330 |
# Capture full traceback to aid debugging (the message may be empty otherwise)
|