Skip to content

Commit

Permalink
update model cards (#338)
Browse files Browse the repository at this point in the history
* add qianfan models

* add check_models

* remove longtext

* update chat-completions

* fix lint

* fix ernie-speed

* update model card
  • Loading branch information
wj-Mcat committed Apr 12, 2024
1 parent 3d7e1ff commit 6910387
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 29 deletions.
16 changes: 10 additions & 6 deletions docs/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ import erniebot
models = erniebot.Model.list()

print(models)
# ernie-3.5 文心大模型(ernie-3.5)
# ernie-turbo 文心大模型(ernie-turbo)
# ernie-4.0 文心大模型(ernie-4.0)
# ernie-longtext 文心大模型(ernie-longtext)
# ernie-text-embedding 文心百中语义模型
# ernie-vilg-v2 文心一格模型
# ernie-3.5 文心大模型(ernie-3.5)
# ernie-lite 文心大模型(ernie-lite)
# ernie-4.0 文心大模型(ernie-4.0)
# ernie-longtext 文心大模型(ernie-longtext)
# ernie-speed 文心大模型(ernie-speed)
# ernie-speed-128k 文心大模型(ernie-speed-128k)
# ernie-tiny-8k 文心大模型(ernie-tiny-8k)
# ernie-char-8k 文心大模型(ernie-char-8k)
# ernie-text-embedding 文心百中语义模型
# ernie-vilg-v2 文心一格模型

# Set authentication params
erniebot.api_type = "aistudio"
Expand Down
20 changes: 12 additions & 8 deletions docs/sdk/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

ERNIE Bot支持的所有模型如下:

| 模型名称 | 说明 | 功能 | 支持该模型的后端 | 输入token数量上限 |
|:--- | :--- | :--- | :--- | :--- |
| ernie-3.5 | 文心大模型3.5版本。具备优秀的知识增强和内容生成能力,在文本创作、问答、推理和代码生成等方面表现出色。 | 对话补全,函数调用 | qianfan,aistudio | 3000 |
| ernie-turbo | 文心大模型。相比ernie-3.5模型具备更快的响应速度和学习能力,API调用成本更低。 | 对话补全 | qianfan,aistudio | 3000 |
| ernie-4.0 | 文心大模型4.0版本,具备目前系列模型中最优的理解和生成能力。 | 对话补全,函数调用 | qianfan,aistudio | 3000 |
| ernie-longtext | 文心大模型。在ernie-3.5模型的基础上增强了对长对话上下文的支持,输入token数量上限为7000。 | 对话补全,函数调用 | qianfan,aistudio | 7000 |
| ernie-text-embedding | 文心百中语义模型。支持计算最多384个token的文本的向量表示。 | 语义向量 | qianfan,aistudio | 384*16 |
| ernie-vilg-v2 | 文心一格模型。 | 文生图 | yinian | 200 |
| 模型名称 | 说明 | 功能 | 支持该模型的后端 | 输入token数量上限 | 输出token数量上限 |
|---------------------- |--------------------------------------------------------------------------------------------------------------------------------------- |-------------------- |------------------- |------------------------------------------------------------------------------------------------- |------------------- |
| ernie-3.5 | 文心大模型3.5版本。具备优秀的知识增强和内容生成能力,在文本创作、问答、推理和代码生成等方面表现出色。 | 对话补全,函数调用 | qianfan,aistudio | message中的content总长度、functions和system字段总内容不能超过20000个字符,且不能超过5120 tokens | 2048 |
| ernie-lite | ERNIE Lite是百度自研的轻量级大语言模型,兼顾优异的模型效果与推理性能,适合低算力AI加速卡推理使用。 | 对话补全 | qianfan,aistudio | message中的content总长度和system字段总内容不能超过11200个字符,且不能超过7168 tokens | 1024 |
| ernie-4.0 | 文心大模型4.0版本,具备目前系列模型中最优的理解和生成能力。 | 对话补全,函数调用 | qianfan,aistudio | message中的content总长度和system字段总内容不能超过20000个字符,且不能超过5120 tokens | 2048 |
| ernie-longtext | 文心大模型。在ernie-3.5模型的基础上增强了对长对话上下文的支持,输入token数量上限为7000。 | 对话补全,函数调用 | qianfan,aistudio | message中的content总长度、functions和system字段总内容不能超过20000个字符,且不能超过5120 tokens | 2048 |
| ernie-speed | ERNIE Speed是百度自研高性能大语言模型,通用能力优异,适合作为基座模型进行精调,更好地处理特定场景问题,同时具备极佳的推理性能 | 对话补全 | qianfan,aistudio | message中的content总长度和system字段总内容不能超过24000个字符,且不能超过6144 tokens | 2048 |
| ernie-speed-128k | ERNIE Speed是百度自研高性能大语言模型,通用能力优异,适合作为基座模型进行精调,更好地处理特定场景问题,同时具备极佳的推理性能。 | 对话补全 | qianfan,aistudio | message中的content总长度和system字段总内容不能超过516096个字符,且不能超过126976 tokens | 4096 |
| ernie-tiny-8k | ERNIE Tiny是百度自研的超高性能大语言模型,部署与精调成本在文心系列模型中最低 | 对话补全 | qianfan,aistudio | message中的content总长度和system字段总内容不能超过24000个字符,且不能超过6144 tokens | 2048 |
| ernie-char-8k | 百度自研的垂直场景大语言模型,适合游戏NPC、客服对话、对话角色扮演等应用场景,人设风格更为鲜明、一致,指令遵循能力更强,推理性能更优。 | 对话补全 | qianfan,aistudio | message中的content总长度和system字段总内容不能超过24000个字符,且不能超过6144 tokens | 2048 |
| ernie-text-embedding | 文心百中语义模型。支持计算最多384个token的文本的向量表示。 | 语义向量 | qianfan,aistudio | 384*16 | |
| ernie-vilg-v2 | 文心一格模型。 | 文生图 | yinian | 200 | |
20 changes: 5 additions & 15 deletions erniebot/src/erniebot/resources/chat_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ChatCompletion(EBResource, CreatableWithStreaming):
"ernie-3.5-8k": {
"model_id": "completions",
},
"ernie-turbo": {
"ernie-lite": {
"model_id": "eb-instant",
},
"ernie-4.0": {
Expand Down Expand Up @@ -91,7 +91,7 @@ class ChatCompletion(EBResource, CreatableWithStreaming):
"ernie-3.5-8k": {
"model_id": "completions",
},
"ernie-turbo": {
"ernie-lite": {
"model_id": "eb-instant",
},
"ernie-4.0": {
Expand Down Expand Up @@ -449,18 +449,7 @@ async def acreate(
return transform(ChatCompletionResponse.from_mapping, resp)

def _check_model_kwargs(self, model_name: str, kwargs: Dict[str, Any]) -> None:
if model_name in ("ernie-turbo",):
for arg in (
"functions",
"stop",
"disable_search",
"enable_citation",
"tool_choice",
):
if arg in kwargs:
raise errors.InvalidArgumentError(f"`{arg}` is not supported by the {model_name} model.")

if model_name in ("ernie-speed", "ernie-speed-128k", "ernie-char-8k", "ernie-tiny-8k"):
if model_name in ("ernie-speed", "ernie-speed-128k", "ernie-char-8k", "ernie-tiny-8k", "ernie-lite"):
for arg in (
"functions",
"disable_search",
Expand Down Expand Up @@ -519,10 +508,11 @@ def _set_val_if_key_exists(src: dict, dst: dict, key: str) -> None:
model,
{
"ernie-bot": "ernie-3.5",
"ernie-bot-turbo": "ernie-turbo",
"ernie-bot-turbo": "ernie-lite",
"ernie-bot-4": "ernie-4.0",
"ernie-bot-8k": "ernie-3.5-8k",
"ernie-longtext": "ernie-3.5-8k",
"ernie-turbo": "ernie-lite",
},
)

Expand Down

0 comments on commit 6910387

Please sign in to comment.