You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andrea Cosentino (Jira)" <ji...@apache.org> on 2026/08/27 12:59:00 UTC

[jira] [Work started] (CAMEL-24528) camel-huggingface: four task predictors swallow Python inference errors as success

     [ https://issues.apache.org/jira/browse/CAMEL-24528?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-24528 started by Andrea Cosentino.
------------------------------------------------
> camel-huggingface: four task predictors swallow Python inference errors as success
> ----------------------------------------------------------------------------------
>
>                 Key: CAMEL-24528
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24528
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ai
>            Reporter: Andrea Cosentino
>            Assignee: Andrea Cosentino
>            Priority: Major
>             Fix For: 4.23.0
>
>
> TextGenerationPredictor, SummarizationPredictor, QuestionAnsweringPredictor and TextToImagePredictor set the message body from output.getAsString("data") WITHOUT the error guard that the other predictors (TextClassification, ZeroShot, SentenceEmbeddings, ASR, TTS, Chat) have:
>   if (result.contains("\"error\"")) { throw new RuntimeCamelException("Python inference failed: " + result); }
> Each .py returns json.dumps({"error": str(e)}) in "data" on failure, so a model/CUDA/OOM error makes the route SUCCEED with body = the error JSON string masquerading as the generated text/summary/answer (for text-to-image, the error bytes are returned with Content-Type image/png).
> Fix: add the same error guard before setting the body (for text-to-image, inspect the bytes).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)