diff --git a/docs/pipeline_usage/tutorials/ocr_pipelines/PaddleOCR-VL.md b/docs/pipeline_usage/tutorials/ocr_pipelines/PaddleOCR-VL.md index 455ccd09d1..251deaa29c 100644 --- a/docs/pipeline_usage/tutorials/ocr_pipelines/PaddleOCR-VL.md +++ b/docs/pipeline_usage/tutorials/ocr_pipelines/PaddleOCR-VL.md @@ -984,6 +984,7 @@ VLRecognition: genai_config: backend: vllm-server server_url: http://127.0.0.1:8118/v1 + api_key: "secret" ``` 之后,可以使用修改好的配置文件进行产线调用。例如通过 CLI 调用: diff --git a/paddlex/inference/models/base/predictor/base_predictor.py b/paddlex/inference/models/base/predictor/base_predictor.py index db0a4323d0..4ef3262224 100644 --- a/paddlex/inference/models/base/predictor/base_predictor.py +++ b/paddlex/inference/models/base/predictor/base_predictor.py @@ -136,6 +136,7 @@ def __init__( self._genai_client = GenAIClient( backend=genai_config.backend, base_url=genai_config.server_url, + api_key=genai_config.api_key, max_concurrency=genai_config.max_concurrency, model_name=model_name, **(genai_config.client_kwargs or {}), diff --git a/paddlex/inference/models/common/genai.py b/paddlex/inference/models/common/genai.py index ce274dd394..b80675667f 100644 --- a/paddlex/inference/models/common/genai.py +++ b/paddlex/inference/models/common/genai.py @@ -33,6 +33,7 @@ class GenAIConfig(BaseModel): "native" ) server_url: Optional[str] = None + api_key: Optional[str] = "null" max_concurrency: int = 200 client_kwargs: Optional[Dict[str, Any]] = None