Spaces:
Sleeping
Sleeping
ming
commited on
Commit
·
734e281
1
Parent(s):
6b859f2
Improve error messaging for Outlines unavailability
Browse files
app/services/structured_summarizer.py
CHANGED
|
@@ -887,8 +887,15 @@ Rules:
|
|
| 887 |
"""
|
| 888 |
if not self.outlines_model:
|
| 889 |
logger.error("❌ Outlines model not available for V4")
|
| 890 |
-
#
|
| 891 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 892 |
yield json.dumps(error_obj)
|
| 893 |
return
|
| 894 |
|
|
|
|
| 887 |
"""
|
| 888 |
if not self.outlines_model:
|
| 889 |
logger.error("❌ Outlines model not available for V4")
|
| 890 |
+
# Provide detailed error information
|
| 891 |
+
if not OUTLINES_AVAILABLE:
|
| 892 |
+
error_msg = "Outlines library not installed. Please install outlines>=0.0.34."
|
| 893 |
+
elif not self.model or not self.tokenizer:
|
| 894 |
+
error_msg = "Base V4 model not loaded. Outlines wrapper cannot be created."
|
| 895 |
+
else:
|
| 896 |
+
error_msg = "Outlines model wrapper initialization failed. Check server logs for details."
|
| 897 |
+
|
| 898 |
+
error_obj = {"error": "V4 Outlines model not available", "detail": error_msg}
|
| 899 |
yield json.dumps(error_obj)
|
| 900 |
return
|
| 901 |
|