From 6dea1d5646fcf91d9eb1775aa928bd7faffb81a0 Mon Sep 17 00:00:00 2001 From: wenmeng zhou Date: Mon, 26 Jun 2023 11:23:10 +0800 Subject: [PATCH] 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 --- .github/workflows/citest.yaml | 1 + MANIFEST.in | 1 + README.md | 12 +++++- README_zh.md | 12 +++++- .../test_controllable_image_generation.py | 40 ++++--------------- 5 files changed, 29 insertions(+), 37 deletions(-) diff --git a/.github/workflows/citest.yaml b/.github/workflows/citest.yaml index 5b0e61f2..1ff78a65 100644 --- a/.github/workflows/citest.yaml +++ b/.github/workflows/citest.yaml @@ -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 diff --git a/MANIFEST.in b/MANIFEST.in index 3cd79b03..c1739719 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,2 @@ recursive-include modelscope/configs *.py *.cu *.h *.cpp +recursive-include modelscope/cli/template *.tpl diff --git a/README.md b/README.md index c9b071ab..4a4ce792 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/README_zh.md b/README_zh.md index 05d00730..f5401f33 100644 --- a/README_zh.md +++ b/README_zh.md @@ -189,12 +189,20 @@ ModelScope Library目前支持tensorflow,pytorch深度学习框架进行模型 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环境 diff --git a/tests/pipelines/test_controllable_image_generation.py b/tests/pipelines/test_controllable_image_generation.py index 7d6b03ce..c1a29f5b 100644 --- a/tests/pipelines/test_controllable_image_generation.py +++ b/tests/pipelines/test_controllable_image_generation.py @@ -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(