mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2025-12-13 07:47:12 +00:00
sup functions for pp_chatocrv4_doc (#15932)
* sup functions for pp_chatocrv4_doc * sup parameters for pp_doctranslation
This commit is contained in:
parent
402065c53f
commit
aeef330434
@ -2146,8 +2146,8 @@ Returns the actual angle value when enabled (e.g., [0,0,1])
|
||||
<td><code>None</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>chat_bot_config</code></td>
|
||||
<td>Large language model configuration. Set to <code>None</code> to use instantiation parameters; otherwise, this parameter takes precedence.</td>
|
||||
<td><code>glossary</code></td>
|
||||
<td>Glossary of translation terms.</td>
|
||||
<td><code>dict|None</code></td>
|
||||
<td><code>None</code></td>
|
||||
</tr>
|
||||
@ -2155,7 +2155,13 @@ Returns the actual angle value when enabled (e.g., [0,0,1])
|
||||
<td><code>llm_request_interval</code></td>
|
||||
<td>The 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><code>0</code></td>
|
||||
<td><code>0.0</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>chat_bot_config</code></td>
|
||||
<td>Large language model configuration. Set to <code>None</code> to use instantiation parameters; otherwise, this parameter takes precedence.</td>
|
||||
<td><code>dict|None</code></td>
|
||||
<td><code>None</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -2626,9 +2632,9 @@ Below are the API references for basic serving and examples of multilingual serv
|
||||
<td>No</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>chatBotConfig</code></td>
|
||||
<td><code>glossary</code></td>
|
||||
<td><code>object</code>|<code>null</code></td>
|
||||
<td>Refer to the description of the <code>chat_bot_config</code> parameter in the <code>translate</code> method of the pipeline object.</td>
|
||||
<td>Refer to the description of the <code>glossary</code> parameter in the <code>translate</code> method of the pipeline object.</td>
|
||||
<td>No</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -2637,6 +2643,12 @@ Below are the API references for basic serving and examples of multilingual serv
|
||||
<td>Refer to the description of the <code>llm_request_interval</code> parameter in the <code>translate</code> method of 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>chat_bot_config</code> parameter in the <code>translate</code> method of the pipeline object.</td>
|
||||
<td>No</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<ul>
|
||||
|
||||
@ -2256,8 +2256,8 @@ MKL-DNN 缓存容量。
|
||||
<td><code>None</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>chat_bot_config</code></td>
|
||||
<td>大语言模型配置。设置为<code>None</code>表示使用实例化参数,否则该参数优先级更高。</td>
|
||||
<td><code>glossary</code></td>
|
||||
<td>翻译专业术语对照表。</td>
|
||||
<td><code>dict|None</code></td>
|
||||
<td><code>None</code></td>
|
||||
</tr>
|
||||
@ -2265,7 +2265,13 @@ MKL-DNN 缓存容量。
|
||||
<td><code>llm_request_interval</code></td>
|
||||
<td>向大语言模型发送请求的时间间隔,单位为秒。该参数可用于防止过于频繁地调用大语言模型。</td>
|
||||
<td><code>float</code></td>
|
||||
<td><code>0</code></td>
|
||||
<td><code>0.0</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>chat_bot_config</code></td>
|
||||
<td>大语言模型配置。设置为<code>None</code>表示使用实例化参数,否则该参数优先级更高。</td>
|
||||
<td><code>dict|None</code></td>
|
||||
<td><code>None</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -2743,9 +2749,9 @@ MKL-DNN 缓存容量。
|
||||
<td>否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>chatBotConfig</code></td>
|
||||
<td><code>glossary</code></td>
|
||||
<td><code>object</code> | <code>null</code></td>
|
||||
<td>请参阅产线对象中 <code>translate</code> 方法的 <code>chat_bot_config</code> 参数相关说明。</td>
|
||||
<td>请参阅产线对象中 <code>translate</code> 方法的 <code>glossary</code> 参数相关说明。</td>
|
||||
<td>否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -2754,6 +2760,12 @@ MKL-DNN 缓存容量。
|
||||
<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>
|
||||
|
||||
@ -81,6 +81,21 @@ class PPChatOCRv4Doc(PaddleXPipelineWrapper):
|
||||
def _paddlex_pipeline_name(self):
|
||||
return "PP-ChatOCRv4-doc"
|
||||
|
||||
def save_vector(self, vector_info, save_path, retriever_config=None):
|
||||
return self.paddlex_pipeline.save_vector(
|
||||
vector_info=vector_info,
|
||||
save_path=save_path,
|
||||
retriever_config=retriever_config,
|
||||
)
|
||||
|
||||
def load_vector(self, data_path, retriever_config=None):
|
||||
return self.paddlex_pipeline.load_vector(
|
||||
data_path=data_path, retriever_config=retriever_config
|
||||
)
|
||||
|
||||
def load_visual_info_list(self, data_path):
|
||||
return self.paddlex_pipeline.load_visual_info_list(data_path=data_path)
|
||||
|
||||
def visual_predict_iter(
|
||||
self,
|
||||
input,
|
||||
|
||||
@ -256,6 +256,8 @@ class PPDocTranslation(PaddleXPipelineWrapper):
|
||||
rules_str=None,
|
||||
few_shot_demo_text_content=None,
|
||||
few_shot_demo_key_value_list=None,
|
||||
glossary=None,
|
||||
llm_request_interval=0.0,
|
||||
chat_bot_config=None,
|
||||
**kwargs,
|
||||
):
|
||||
@ -268,6 +270,8 @@ class PPDocTranslation(PaddleXPipelineWrapper):
|
||||
rules_str=rules_str,
|
||||
few_shot_demo_text_content=few_shot_demo_text_content,
|
||||
few_shot_demo_key_value_list=few_shot_demo_key_value_list,
|
||||
glossary=glossary,
|
||||
llm_request_interval=llm_request_interval,
|
||||
chat_bot_config=chat_bot_config,
|
||||
**kwargs,
|
||||
)
|
||||
@ -283,6 +287,8 @@ class PPDocTranslation(PaddleXPipelineWrapper):
|
||||
rules_str=None,
|
||||
few_shot_demo_text_content=None,
|
||||
few_shot_demo_key_value_list=None,
|
||||
glossary=None,
|
||||
llm_request_interval=0.0,
|
||||
chat_bot_config=None,
|
||||
**kwargs,
|
||||
):
|
||||
@ -296,6 +302,8 @@ class PPDocTranslation(PaddleXPipelineWrapper):
|
||||
rules_str=rules_str,
|
||||
few_shot_demo_text_content=few_shot_demo_text_content,
|
||||
few_shot_demo_key_value_list=few_shot_demo_key_value_list,
|
||||
glossary=glossary,
|
||||
llm_request_interval=llm_request_interval,
|
||||
chat_bot_config=chat_bot_config,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user