codecamp

讯飞星辰 MaaS Windows 推送模型示例 - 模型部署与推送指南

1. 前置信息

以下均用户相关信息均为示例,具体值以页面展示为准

示例信息:

项目
操作系统 Windows
用户id us****1
s3 access_key RslT**hnp
s3 secret_key GwcIePONT**MOBPHHBrVxImX
s3 host sgw-dx-maas.xf-yun.com
模型名称 mo****1

前置条件:

  • 安装 Python(建议 3.7+):可从 https://www.python.org/downloads/ 下载并安装
  • 安装时勾选 "Add Python to PATH"

2. 操作流程

2.1 Step 1

win+R输入powershell 敲回车,打开powershell窗口

2.2 Step 2

执行以下命令安装s3cmd (推荐2.4.0版本)

pip install s3cmd==2.4.0

安装成功后,显示s3cmd版本信息

2.3 Step 3

执行命令查找s3cmd包安装路径

pip list -v | Select-String s3cmd

查找成功,显示信息

获得 s3cmd脚本安装目录:脚本安装在 Scripts 目录中,与 Lib\site-packages 同级

2.4 Step 4

创建s3cmd"兼容S3的存储服务"配置文件

$configContent = @"
access_key = RslTtM...LfJhnp(请替换为MaaS平台展示的信息)
secret_key = GwcIePONTGM...BrVxImX(请替换为MaaS平台展示的信息)
host_base = sgw-dx-maas.xf-yun.com(请替换为MaaS平台展示的信息)
host_bucket = sgw-dx-maas.xf-yun.com/%(bucket)(请替换为MaaS平台展示的信息)
use_https = False
check_ssl_certificate = False
"@; $configContent | Out-File -FilePath ".\s3.cfg" -Encoding ASCII

2.5 Step 5

创建函数别名,方便执行s3cmd命令

function s3cmd {
& python "C:\Users\tyli11\AppData\Local\Programs\Python\Python314\Scripts\s3cmd" @args
}

注意:请将路径替换为您在Step 3中找到的实际s3cmd脚本路径

2.6 Step 6

示例:使用s3cmd推送s3.cfg文件到用户(user01)模型(model01)下

s3cmd -c .\s3.cfg put s3.cfg s3://private-model-hub/user01/model01/s3.cfg

推送成功,显示信息

附录:配置说明

前置信息详细说明:

  • 操作系统: Windows

  • 用户信息

  • 用户id: us****1
  • s3 access_key: RslT******hnp
  • s3 secret_key: GwcIePONT******MOBPHHBrVxImX
  • s3 host: sgw-dx-maas.xf-yun.com

  • 模型名称: mo****1

重要提示:

  1. 所有示例中的用户信息均需替换为MaaS平台展示的实际信息
  2. 推荐使用s3cmd 2.4.0版本
  3. 安装Python时务必勾选"Add Python to PATH"
  4. Step 3中查找的s3cmd路径需要在Step 5中使用
  5. 配置文件默认保存在当前目录的 s3.cfg
  6. 推送路径格式:s3://private-model-hub/{用户名}/{模型名}/{文件名}

常见问题:

  • 找不到s3cmd命令:确认Python已添加到PATH,或使用完整路径执行
  • 推送失败:检查配置文件中的access_key、secret_key等信息是否正确
  • 权限错误:确认用户有相应模型的写入权限
讯飞星辰 MaaS Linux 推送模型示例 - 模型部署与推送指南
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }