Add MiniMax as alternative LLM provider for ChatOCR and DocTranslation#17879
Open
octo-patch wants to merge 1 commit intoPaddlePaddle:mainfrom
Open
Add MiniMax as alternative LLM provider for ChatOCR and DocTranslation#17879octo-patch wants to merge 1 commit intoPaddlePaddle:mainfrom
octo-patch wants to merge 1 commit intoPaddlePaddle:mainfrom
Conversation
Add MiniMax Cloud (MiniMax-M2.7, 204K context) as an alternative LLM provider for the PP-ChatOCRv4 and PP-DocTranslation pipelines, alongside the existing Qianfan (ERNIE) support. Changes: - Add llm_config.py with get_minimax_chat_bot_config() helper - Add --minimax_api_key CLI argument to both pipeline executors - MiniMax takes precedence when both keys are provided - Support MINIMAX_API_KEY environment variable as secure alternative - Update English and Chinese docs with MiniMax usage examples - Add 10 unit tests and 2 integration tests Co-Authored-By: Octopus <[email protected]>
|
Thanks for your contribution! |
Collaborator
|
Please fix the CodeStyle. |
Collaborator
|
Thanks for your contribution. Please update the method to provide general support for the OpenAI API, rather than only supporting MiniMax. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add MiniMax Cloud as an alternative LLM provider for the PP-ChatOCRv4 and PP-DocTranslation pipelines, alongside the existing Qianfan (ERNIE) support.
What's Changed
llm_config.pymodule: Shared helperget_minimax_chat_bot_config()that builds achat_bot_configdict for MiniMax's OpenAI-compatible API (MiniMax-M2.7, 204K context window)--minimax_api_keyargument to bothpp_chatocrv4_docandpp_doctranslationCLI subcommandsMINIMAX_API_KEYenv var (more secure than CLI)--minimax_api_keyand--qianfan_api_keyare provided, MiniMax takes precedenceAvailable MiniMax Models
Usage
CLI:
Python API:
Files Changed (8 files, ~346 additions)
paddleocr/_pipelines/llm_config.pypaddleocr/_pipelines/pp_chatocrv4_doc.pypaddleocr/_pipelines/pp_doctranslation.pytests/pipelines/test_minimax_llm_config.pydocs/.../PP-ChatOCRv4.en.mddocs/.../PP-ChatOCRv4.mddocs/.../PP-DocTranslation.en.mddocs/.../PP-DocTranslation.mdTest Plan