Skip to content

Commit

Permalink
Merge pull request baidubce#59 from baidubce/fix-model-params
Browse files Browse the repository at this point in the history
feat: update supported params for default models
  • Loading branch information
stonekim authored Nov 9, 2023
2 parents 26de7c9 + e6011e5 commit 689c923
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/qianfan/resources/llm/chat_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
"top_p",
"penalty_score",
"user_id",
"system",
},
),
"ERNIE-Bot": QfLLMInfo(
Expand Down Expand Up @@ -108,6 +109,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"Llama-2-7b-chat": QfLLMInfo(
Expand All @@ -116,6 +122,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"Llama-2-13b-chat": QfLLMInfo(
Expand All @@ -124,6 +135,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"Llama-2-70b-chat": QfLLMInfo(
Expand All @@ -132,6 +148,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"Qianfan-BLOOMZ-7B-compressed": QfLLMInfo(
Expand All @@ -140,6 +161,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"Qianfan-Chinese-Llama-2-7B": QfLLMInfo(
Expand All @@ -148,6 +174,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"ChatGLM2-6B-32K": QfLLMInfo(
Expand All @@ -156,6 +187,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"AquilaChat-7B": QfLLMInfo(
Expand All @@ -164,6 +200,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
UNSPECIFIED_MODEL: QfLLMInfo(
Expand Down
41 changes: 41 additions & 0 deletions src/qianfan/resources/llm/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
"top_p",
"penalty_score",
"user_id",
"system",
},
),
"ERNIE-Bot": QfLLMInfo(
Expand Down Expand Up @@ -104,6 +105,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"Llama-2-7b-chat": QfLLMInfo(
Expand All @@ -112,6 +118,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"Llama-2-13b-chat": QfLLMInfo(
Expand All @@ -120,6 +131,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"Llama-2-70b-chat": QfLLMInfo(
Expand All @@ -128,6 +144,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"Qianfan-BLOOMZ-7B-compressed": QfLLMInfo(
Expand All @@ -136,6 +157,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"Qianfan-Chinese-Llama-2-7B": QfLLMInfo(
Expand All @@ -144,6 +170,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"ChatGLM2-6B-32K": QfLLMInfo(
Expand All @@ -152,6 +183,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
"AquilaChat-7B": QfLLMInfo(
Expand All @@ -160,6 +196,11 @@ def _supported_models(cls) -> Dict[str, QfLLMInfo]:
optional_keys={
"stream",
"user_id",
"temperature",
"top_k",
"top_p",
"penalty_score",
"stop",
},
),
UNSPECIFIED_MODEL: QfLLMInfo(
Expand Down

0 comments on commit 689c923

Please sign in to comment.