产品 |
是否支持 |
---|---|
√ |
|
x |
|
x |
|
x |
|
x |
切换当前LLMDataDist的角色,建议仅在使用PagedAttention的场景使用,在开启CacheManager的情况下,不同角色功能没有限制,调用该接口直接返回,无任何作用。
1 | switch_role(role: LLMRole, switch_options: Optional[Dict[str, str]]) |
参数名称 |
数据类型 |
取值说明 |
---|---|---|
role |
切换的目标角色。 |
|
switch_options |
options: Dict[str, str] |
切换角色配置项。 切换为Prompt时需要设置,其中需包含llm.listenIpInfo配置项。 |
1 2 3 4 5 | from llm_datadist import LLMDataDist, LLMRole llm_datadist = LLMDataDist(LLMRole.DECODER, 0) ... switch_options = { 'llm.listenIpInfo': '127.0.0.1:26000' } llm_datadist.switch_role(LLMRole.PROMPT, switch_options) |
无