浏览代码

Fix bug and add glossary (#4318)

Lin Manhui 4 月之前
父节点
当前提交
b02174ced3

+ 7 - 7
docs/pipeline_usage/tutorials/ocr_pipelines/PP-DocTranslation.en.md

@@ -1397,7 +1397,7 @@ After executing the above code, you will obtain the parsed results of the origin
 <td>Time interval in seconds for sending requests to the large language model. This parameter can be used to prevent overly frequent calls to the large language model.</td>
 <td><code>float</code></td>
 <td>A floating-point number greater than or equal to 0</td>
-<td><code>0</code></td>
+<td><code>0.0</code></td>
 </tr>
 <tr>
 <td><code>chat_bot_config</code></td>
@@ -1938,17 +1938,17 @@ The following is the API reference for basic Serving and examples of multilingua
 <td>No</td>
 </tr>
 <tr>
-<td><code>chatBotConfig</code></td>
-<td><code>object</code>|<code>null</code></td>
-<td>Refer to the description of the <code>translate</code>method's<code>chat_bot_config</code>parameter in the pipeline object.</td>
-<td>No</td>
-</tr>
-<tr>
 <td><code>llmRequestInterval</code></td>
 <td><code>number</code>|<code>null</code></td>
 <td>Refer to the description of the <code>translate</code>method's<code>llm_request_interval</code>parameter in the pipeline object.</td>
 <td>No</td>
 </tr>
+<tr>
+<td><code>chatBotConfig</code></td>
+<td><code>object</code>|<code>null</code></td>
+<td>Refer to the description of the <code>translate</code>method's<code>chat_bot_config</code>parameter in the pipeline object.</td>
+<td>No</td>
+</tr>
 </tbody>
 </table>
 <ul>

+ 6 - 6
docs/pipeline_usage/tutorials/ocr_pipelines/PP-DocTranslation.md

@@ -1998,17 +1998,17 @@ for tgt_md_info in tgt_md_info_list:
 <td>否</td>
 </tr>
 <tr>
-<td><code>chatBotConfig</code></td>
-<td><code>object</code> | <code>null</code></td>
-<td>请参阅产线对象中 <code>translate</code> 方法的 <code>chat_bot_config</code> 参数相关说明。</td>
-<td>否</td>
-</tr>
-<tr>
 <td><code>llmRequestInterval</code></td>
 <td><code>number</code> | <code>null</code></td>
 <td>请参阅产线对象中 <code>translate</code> 方法的 <code>llm_request_interval</code> 参数相关说明。</td>
 <td>否</td>
 </tr>
+<tr>
+<td><code>chatBotConfig</code></td>
+<td><code>object</code> | <code>null</code></td>
+<td>请参阅产线对象中 <code>translate</code> 方法的 <code>chat_bot_config</code> 参数相关说明。</td>
+<td>否</td>
+</tr>
 </tbody>
 </table>
 <ul>

+ 2 - 1
paddlex/inference/serving/basic_serving/_pipeline_apps/pp_doctranslation.py

@@ -176,8 +176,9 @@ def create_pipeline_app(pipeline: Any, app_config: AppConfig) -> "FastAPI":
             rules_str=request.rulesStr,
             few_shot_demo_text_content=request.fewShotDemoTextContent,
             few_shot_demo_key_value_list=request.fewShotDemoKeyValueList,
-            chat_bot_config=request.chatBotConfig,
+            glossary=request.glossary,
             llm_request_interval=request.llmRequestInterval,
+            chat_bot_config=request.chatBotConfig,
         )
 
         translation_results: List[Dict[str, Any]] = []

+ 2 - 1
paddlex/inference/serving/schemas/pp_doctranslation.py

@@ -92,8 +92,9 @@ class TranslateRequest(BaseModel):
     rulesStr: Optional[str] = None
     fewShotDemoTextContent: Optional[str] = None
     fewShotDemoKeyValueList: Optional[str] = None
+    glossary: Optional[dict] = None
+    llmRequestInterval: float = 0.0
     chatBotConfig: Optional[dict] = None
-    sleepInterval: float = 0
 
 
 class TranslationResult(BaseModel):