Fix/citest timeout (#308)

* timeout for citest set to 240min

* update docker image

* fix ci template not packed in whl

* update docker image version to 1.6.1 and add python3.8 support

* randome choose a model for controlnet to avoid oom
This commit is contained in:
wenmeng zhou
2023-06-26 11:23:10 +08:00
committed by GitHub
parent 84070cc2f5
commit 6dea1d5646
5 changed files with 29 additions and 37 deletions

View File

@@ -40,6 +40,7 @@ jobs:
unittest:
# The type of runner that the job will run on
runs-on: [modelscope-self-hosted]
timeout-minutes: 240
steps:
- name: ResetFileMode
shell: bash

View File

@@ -1 +1,2 @@
recursive-include modelscope/configs *.py *.cu *.h *.cpp
recursive-include modelscope/cli/template *.tpl

View File

@@ -203,12 +203,20 @@ To allow out-of-box usage for all the models on ModelScope, official docker imag
CPU docker image
```shell
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-py37-torch1.11.0-tf1.15.5-1.3.0
# py37
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-py37-torch1.11.0-tf1.15.5-1.6.1
# py38
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-py38-torch1.11.0-tf1.15.5-1.6.1
```
GPU docker image
```shell
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.3.0-py37-torch1.11.0-tf1.15.5-1.3.0
# py37
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.3.0-py37-torch1.11.0-tf1.15.5-1.6.1
# py38
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.3.0-py38-torch1.11.0-tf1.15.5-1.6.1
```
## Setup Local Python Environment

View File

@@ -189,12 +189,20 @@ ModelScope Library目前支持tensorflowpytorch深度学习框架进行模型
CPU镜像
```shell
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-py37-torch1.11.0-tf1.15.5-1.3.0
# py37
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-py37-torch1.11.0-tf1.15.5-1.6.1
# py38
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-py38-torch1.11.0-tf1.15.5-1.6.1
```
GPU镜像
```shell
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.3.0-py37-torch1.11.0-tf1.15.5-1.3.0
# py37
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.3.0-py37-torch1.11.0-tf1.15.5-1.6.1
# py38
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.3.0-py38-torch1.11.0-tf1.15.5-1.6.1
```
## 搭建本地Python环境

View File

@@ -1,4 +1,5 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
import random
import tempfile
import unittest
@@ -27,40 +28,13 @@ class ControllableImageGenerationTest(unittest.TestCase):
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
def test_run_with_model_from_modelhub(self):
output_image_path = tempfile.NamedTemporaryFile(suffix='.png').name
control_types = [
'canny', 'hough', 'hed', 'depth', 'normal', 'pose', 'seg',
'fake_scribble', 'scribble'
]
control_type = random.choice(control_types)
pipeline_ins = pipeline(
self.task, model=self.model_id, control_type='canny')
output = pipeline_ins(input=self.input)[OutputKeys.OUTPUT_IMG]
pipeline_ins = pipeline(
self.task, model=self.model_id, control_type='hough')
output = pipeline_ins(input=self.input)[OutputKeys.OUTPUT_IMG]
pipeline_ins = pipeline(
self.task, model=self.model_id, control_type='hed')
output = pipeline_ins(input=self.input)[OutputKeys.OUTPUT_IMG]
pipeline_ins = pipeline(
self.task, model=self.model_id, control_type='depth')
output = pipeline_ins(input=self.input)[OutputKeys.OUTPUT_IMG]
pipeline_ins = pipeline(
self.task, model=self.model_id, control_type='normal')
output = pipeline_ins(input=self.input)[OutputKeys.OUTPUT_IMG]
pipeline_ins = pipeline(
self.task, model=self.model_id, control_type='pose')
output = pipeline_ins(input=self.input)[OutputKeys.OUTPUT_IMG]
pipeline_ins = pipeline(
self.task, model=self.model_id, control_type='seg')
output = pipeline_ins(input=self.input)[OutputKeys.OUTPUT_IMG]
pipeline_ins = pipeline(
self.task, model=self.model_id, control_type='fake_scribble')
output = pipeline_ins(input=self.input)[OutputKeys.OUTPUT_IMG]
pipeline_ins = pipeline(
self.task, model=self.model_id, control_type='scribble')
self.task, model=self.model_id, control_type=control_type)
output = pipeline_ins(input=self.input)[OutputKeys.OUTPUT_IMG]
cv2.imwrite(output_image_path, output)
print(