Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
opencompass
Commits
c220550f
Unverified
Commit
c220550f
authored
Apr 02, 2024
by
Y0oMu
Committed by
GitHub
Apr 02, 2024
Browse files
updates docs (#1015)
Co-authored-by:
youmuspc
<
yejiayi2004@outlook.com
>
parent
02e7eec9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
docs/zh_cn/advanced_guides/new_model.md
docs/zh_cn/advanced_guides/new_model.md
+1
-1
No files found.
docs/zh_cn/advanced_guides/new_model.md
View file @
c220550f
...
@@ -42,7 +42,7 @@ class MyModelAPI(BaseAPIModel):
...
@@ -42,7 +42,7 @@ class MyModelAPI(BaseAPIModel):
## 新增第三方模型
## 新增第三方模型
新增基于
API
的模型,需要在
`opencompass/models`
下新建
`mymodel.py`
文件,继承
`BaseModel`
,并实现
`generate`
方法来进行生成式推理,
`get_ppl`
方法来进行判别式推理,以及
`get_token_len`
方法来计算 token 的长度。在定义好之后修改对应配置文件名称即可。
新增基于
第三方
的模型,需要在
`opencompass/models`
下新建
`mymodel.py`
文件,继承
`BaseModel`
,并实现
`generate`
方法来进行生成式推理,
`get_ppl`
方法来进行判别式推理,以及
`get_token_len`
方法来计算 token 的长度。在定义好之后修改对应配置文件名称即可。
```
python
```
python
from
..base
import
BaseModel
from
..base
import
BaseModel
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment