PG1204 opened a new pull request, #7798:
URL: https://github.com/apache/texera/pull/7798
### What changes were proposed in this PR?
The five structured Hugging Face tasks (`question-answering`,
`table-question-answering`, `zero-shot-classification`, `sentence-similarity`,
`text-ranking`) build a native HF pipeline payload that only `hf-inference`
understands. When the operator fell back to a third-party chat-completions
provider, all three chat branches sent just the prompt cell, dropping the
context, table, candidate labels, or sentence list, so the model answered
without the input that defines the task.
This adds a `_chat_content_for_task` helper to the generated operator that
reformulates each of the five tasks into a chat prompt carrying its full
context, and routes all three chat branches (zai-org, OpenAI-compatible,
unknown-provider fallback) through it. Other tasks pass through unchanged.
`QaRankingCodegen.parsePython` is also extended to read
`choices[0].message.content` from chat responses, keeping the native
`{"answer": ...}` shape as the primary path, the same idiom `ImageTaskCodegen`
already uses.
### Any related issues?
Closes #7195
### How was this PR tested?
131 tests pass in the `WorkflowOperator` Hugging Face suites,
`PythonCodeRawInvalidTextSpec` py-compiles the generated Python for all 117
operators, and `scalafmtCheck` is clean for main and test sources. A new spec
test asserts the helper is emitted and used by every chat branch, with one
assertion per task reformulation; two existing tests were updated where they
pinned the old parse expression.
### Was this PR authored or co-authored using generative AI tooling?
Yes, this PR was co-authored with Claude in compliance with ASF policy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]