mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-09 07:42:39 +02:00
Add try/except fallback in _extract_image for vision LLM failures
This commit is contained in:
parent
caaec2e0a7
commit
d6c4fb8938
1 changed files with 16 additions and 9 deletions
|
|
@ -57,6 +57,7 @@ class EtlPipelineService:
|
||||||
|
|
||||||
async def _extract_image(self, request: EtlRequest) -> EtlResult:
|
async def _extract_image(self, request: EtlRequest) -> EtlResult:
|
||||||
if self._vision_llm:
|
if self._vision_llm:
|
||||||
|
try:
|
||||||
from app.etl_pipeline.parsers.vision_llm import parse_with_vision_llm
|
from app.etl_pipeline.parsers.vision_llm import parse_with_vision_llm
|
||||||
|
|
||||||
content = await parse_with_vision_llm(
|
content = await parse_with_vision_llm(
|
||||||
|
|
@ -67,6 +68,12 @@ class EtlPipelineService:
|
||||||
etl_service="VISION_LLM",
|
etl_service="VISION_LLM",
|
||||||
content_type="image",
|
content_type="image",
|
||||||
)
|
)
|
||||||
|
except Exception:
|
||||||
|
logging.warning(
|
||||||
|
"Vision LLM failed for %s, falling back to document parser",
|
||||||
|
request.filename,
|
||||||
|
exc_info=True,
|
||||||
|
)
|
||||||
|
|
||||||
logging.info(
|
logging.info(
|
||||||
"No vision LLM provided, falling back to document parser for %s",
|
"No vision LLM provided, falling back to document parser for %s",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue