Skip to content

Commit 370dc88

Browse files
committed
feat(model): 升级模型命令行工具和部署接口等,支持 python3.9 和 3.10 等新特性
1 parent e954bc4 commit 370dc88

8 files changed

Lines changed: 464 additions & 148 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ test_env.sh
1616
.python-version
1717
htmlcov/
1818
.env
19-
.env_pro
19+
.env_*

bgesdk/client.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,15 +1102,18 @@ def invoke_draft_model(self, model_id, headers=None, **kwargs):
11021102
return models.Model(result)
11031103

11041104
def deploy_model(self, model_id, object_name=None, runtime=None,
1105-
memory_size=None, timeout=None, **kwargs):
1105+
memory_size=None, cpu=None, disk_size=None,
1106+
timeout=None, **kwargs):
11061107
"""部署模型
11071108
11081109
Args:
11091110
model_id (str): 模型编号。
11101111
object_name (str): 模型源代码文件阿里云 OSS 对象路径。
1111-
runtime (str, optional): 运行环境版本。默认值: python3。
1112-
memory_size (int, optional): 内存占用量,单位: MB。默认: 128MB。
1113-
timeout (int, 非必填): 模型运行超时时间,单位: 秒。默认: 900。
1112+
runtime (str, 非必填): 运行环境版本。默认值: python3。
1113+
memory_size (int, 非必填): 内存占用量,单位: MB。默认: 128MB。
1114+
cpu(float, 非必填): vCPU 核心数。默认:0.05。
1115+
disk_size(int, 非必填): 函数计算磁盘规格,单位:MB。默认:512。
1116+
timeout (int, 非必填): 模型运行超时时间,单位: 秒。默认: 900。
11141117
11151118
Returns:
11161119
Model: 任务id,时间和状态;
@@ -1121,6 +1124,8 @@ def deploy_model(self, model_id, object_name=None, runtime=None,
11211124
'model_id': model_id,
11221125
'runtime': runtime,
11231126
'memory_size': memory_size,
1127+
'cpu': cpu,
1128+
'disk_size': disk_size,
11241129
'timeout': timeout,
11251130
'object_name': object_name
11261131
})

0 commit comments

Comments
 (0)