Spaces:
Sleeping
Sleeping
github-actions[bot] commited on
Commit ·
b0573c2
1
Parent(s): 7971c9e
Deploy latest changes from main branch
Browse files
src/core/services/ml_inference.py
CHANGED
|
@@ -207,7 +207,7 @@ async def run_inference(image_bytes: bytes) -> Dict[str, Any]:
|
|
| 207 |
image_size_bytes=len(image_bytes),
|
| 208 |
latency_ms=cached["latency_ms"],
|
| 209 |
)
|
| 210 |
-
|
| 211 |
return cached
|
| 212 |
|
| 213 |
logger.info(
|
|
@@ -233,7 +233,7 @@ async def run_inference(image_bytes: bytes) -> Dict[str, Any]:
|
|
| 233 |
confidence=result["confidence"],
|
| 234 |
)
|
| 235 |
await redis_manager.set_cache(image_hash, result, ttl=settings.prediction_cache_ttl_s)
|
| 236 |
-
|
| 237 |
return result
|
| 238 |
except (InvalidImageError, UnsupportedImageFormatError, InferenceServiceError):
|
| 239 |
raise
|
|
|
|
| 207 |
image_size_bytes=len(image_bytes),
|
| 208 |
latency_ms=cached["latency_ms"],
|
| 209 |
)
|
| 210 |
+
await asyncio.sleep(20) # TEMP: remove before production
|
| 211 |
return cached
|
| 212 |
|
| 213 |
logger.info(
|
|
|
|
| 233 |
confidence=result["confidence"],
|
| 234 |
)
|
| 235 |
await redis_manager.set_cache(image_hash, result, ttl=settings.prediction_cache_ttl_s)
|
| 236 |
+
await asyncio.sleep(20) # TEMP: remove before production
|
| 237 |
return result
|
| 238 |
except (InvalidImageError, UnsupportedImageFormatError, InferenceServiceError):
|
| 239 |
raise
|