一、前言:
云雀 (Skylark) 是字节内部团队研发的大规模预训练语言模型系列,目前有 lite, plus 和 pro 三个不同规模的版本。
Skylark-chat跟豆包版本对齐(版本更新有1天左右延迟)。
说明:
1、该模型会跟进豆包,更新信息不会主动通知用户;
2、如果业务需要稳定的模型,可以使用skylark-lite/plus/pro等。
二、获取API Key:
1、打开网址:火山引擎-云上增长新动力 注册账号登录
2、登录——控制台——右上角(个人头像)——API访问秘钥
三、Python示例:
注意:目前仅支持 python>=3.5
。
'''
Usage:
1. python3 -m pip install --user volcengine
2. VOLC_ACCESSKEY=XXXXX VOLC_SECRETKEY=YYYYY python main.py
'''
import os
from volcengine.maas import MaasService, MaasException, ChatRole
def test_chat(maas, req):
try:
resp = maas.chat(req)
print(resp)
print(resp.choice.message.content)
except MaasException as e:
print(e)
def test_stream_chat(maas, req):
try:
resps = maas.stream_chat(req)
for resp in resps:
print(resp)
print(resp.choice.message.content)
except MaasException as e:
print(e)
if __name__ == '__main__':
maas = MaasService('maas-api.ml-platform-cn-beijing.volces.com', 'cn-beijing')
# 填写自己密钥信息
maas.set_ak(os.getenv