mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
refactor: 优化aws大模型的参数
This commit is contained in:
parent
c78f216102
commit
f869fc5f26
|
|
@ -10,18 +10,20 @@ def get_max_tokens_keyword(model_name):
|
||||||
:param model_name: 模型名称字符串
|
:param model_name: 模型名称字符串
|
||||||
:return: 对应的 max_tokens 关键字字符串
|
:return: 对应的 max_tokens 关键字字符串
|
||||||
"""
|
"""
|
||||||
if 'amazon' in model_name:
|
maxTokens = ["ai21.j2-ultra-v1", "ai21.j2-mid-v1"]
|
||||||
return 'maxTokenCount'
|
# max_tokens_to_sample = ["anthropic.claude-v2:1", "anthropic.claude-v2", "anthropic.claude-instant-v1"]
|
||||||
elif 'anthropic' in model_name:
|
maxTokenCount = ["amazon.titan-text-lite-v1", "amazon.titan-text-express-v1"]
|
||||||
return 'max_tokens_to_sample'
|
max_new_tokens = [
|
||||||
elif 'ai21' in model_name:
|
"us.meta.llama3-2-1b-instruct-v1:0", "us.meta.llama3-2-3b-instruct-v1:0", "us.meta.llama3-2-11b-instruct-v1:0",
|
||||||
|
"us.meta.llama3-2-90b-instruct-v1:0"]
|
||||||
|
if model_name in maxTokens:
|
||||||
return 'maxTokens'
|
return 'maxTokens'
|
||||||
elif 'cohere' in model_name or 'mistral' in model_name:
|
elif model_name in maxTokenCount:
|
||||||
return 'max_tokens'
|
return 'maxTokenCount'
|
||||||
elif 'meta' in model_name:
|
elif model_name in max_new_tokens:
|
||||||
return 'max_gen_len'
|
return 'max_new_tokens'
|
||||||
else:
|
else:
|
||||||
raise ValueError("Unsupported model supplier in model_name.")
|
return 'max_tokens'
|
||||||
|
|
||||||
|
|
||||||
class BedrockModel(MaxKBBaseModel, BedrockChat):
|
class BedrockModel(MaxKBBaseModel, BedrockChat):
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ cgroups = "^0.1.0"
|
||||||
wasm-exec = "^0.1.9"
|
wasm-exec = "^0.1.9"
|
||||||
|
|
||||||
boto3 = "^1.34.151"
|
boto3 = "^1.34.151"
|
||||||
langchain-aws = "^0.1.13"
|
|
||||||
tencentcloud-sdk-python = "^3.0.1205"
|
tencentcloud-sdk-python = "^3.0.1205"
|
||||||
xinference-client = "^0.14.0.post1"
|
xinference-client = "^0.14.0.post1"
|
||||||
psutil = "^6.0.0"
|
psutil = "^6.0.0"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue