mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-17 08:47:43 +01:00
提供独立repo库快速接入modelscope的小工具,模板创建,模型上传,一键导入、版本管理等命令 Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/11757517
24 lines
532 B
Python
24 lines
532 B
Python
import os
|
|
import shutil
|
|
import subprocess
|
|
import tempfile
|
|
import unittest
|
|
import uuid
|
|
|
|
|
|
class ModelUploadCMDTest(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
self.task_name = 'task-%s' % (uuid.uuid4().hex)
|
|
print(self.task_name)
|
|
|
|
def test_upload_modelcard(self):
|
|
cmd = f'python -m modelscope.cli.cli pipeline --action create --task_name {self.task_name} '
|
|
stat, output = subprocess.getstatusoutput(cmd)
|
|
if stat != 0:
|
|
print(output)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|