|
1 | 1 | name: lcm_dreamshaper
|
| 2 | + |
2 | 3 | on:
|
3 | 4 | pull_request:
|
4 | 5 | paths:
|
|
7 | 8 | - .github/workflows/lcm_dreamshaper_cpp.yml
|
8 | 9 | - thirdparty/openvino_tokenizers
|
9 | 10 | - "!**.md"
|
| 11 | + |
| 12 | +env: |
| 13 | + working_directory: "./image_generation/lcm_dreamshaper_v7/cpp/" |
| 14 | + |
10 | 15 | concurrency:
|
11 | 16 | group: ${{ github.workflow }}-${{ github.ref }}
|
12 | 17 | cancel-in-progress: true
|
| 18 | + |
13 | 19 | jobs:
|
14 | 20 | lcm_dreamshaper_v7_cpp-linux:
|
15 | 21 | runs-on: ubuntu-20.04
|
| 22 | + defaults: |
| 23 | + run: |
| 24 | + # Do not ignore bash profile files. From: |
| 25 | + # https://github.com/marketplace/actions/setup-miniconda#important |
| 26 | + shell: bash -l {0} |
16 | 27 | steps:
|
17 | 28 | - uses: actions/checkout@v4
|
18 | 29 | with:
|
19 | 30 | submodules: recursive
|
20 |
| - - uses: actions/setup-python@v4 |
| 31 | + |
| 32 | + - name: Setup conda |
| 33 | + uses: conda-incubator/setup-miniconda@v3 |
21 | 34 | with:
|
22 |
| - python-version: 3.8 |
23 |
| - - name: Initialize OpenVINO |
| 35 | + miniconda-version: "latest" |
| 36 | + activate-environment: openvino_lcm_cpp |
| 37 | + python-version: "3.10" |
| 38 | + |
| 39 | + - name: Install OpenVINO and other conda dependencies |
24 | 40 | run: |
|
25 |
| - mkdir openvino |
26 |
| - curl https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.1.0-14645-e6dc0865128/l_openvino_toolkit_ubuntu20_2024.1.0.dev20240304_x86_64.tgz | tar --directory ./openvino/ --strip-components 1 -xz |
27 |
| - sudo ./openvino/install_dependencies/install_openvino_dependencies.sh |
28 |
| - - name: Download / convert a model / tokenizer |
| 41 | + conda activate openvino_lcm_cpp |
| 42 | + conda update -c conda-forge --all |
| 43 | + conda install -c conda-forge openvino=2024.1.0 c-compiler cxx-compiler git make cmake |
| 44 | + conda env config vars set LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH |
| 45 | + |
| 46 | + - name: Install python dependencies |
| 47 | + working-directory: ${{ env.working_directory }} |
29 | 48 | run: |
|
30 |
| - source ./openvino/setupvars.sh |
31 |
| - cd ./image_generation/lcm_dreamshaper_v7/cpp/scripts/ |
32 |
| - python -m pip install -U pip |
33 |
| - python -m pip install -r ./requirements.txt |
34 |
| - python -m pip install ../../../../thirdparty/openvino_tokenizers/ |
35 |
| - python convert_model.py -lcm "SimianLuo/LCM_Dreamshaper_v7" -t "FP16" |
| 49 | + conda activate openvino_lcm_cpp |
| 50 | + python -m pip install -r requirements.txt |
| 51 | + python -m pip install ../../../thirdparty/openvino_tokenizers/[transformers] |
| 52 | + |
| 53 | + - name: Download and convert model and tokenizer |
| 54 | + working-directory: ${{ env.working_directory }} |
| 55 | + run: | |
| 56 | + conda activate openvino_lcm_cpp |
| 57 | + optimum-cli export openvino --model SimianLuo/LCM_Dreamshaper_v7 --weight-format fp16 models/lcm_dreamshaper_v7/FP16 |
| 58 | +
|
36 | 59 | - name: Build app
|
| 60 | + working-directory: ${{ env.working_directory }} |
37 | 61 | run: |
|
38 |
| - source ./openvino/setupvars.sh |
39 |
| - cd ./image_generation/lcm_dreamshaper_v7/cpp/ |
| 62 | + conda activate openvino_lcm_cpp |
40 | 63 | cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
|
41 | 64 | cmake --build ./build/ --config Release --parallel
|
| 65 | + |
42 | 66 | - name: Run app
|
43 |
| - run: | |
44 |
| - source ./openvino/setupvars.sh |
45 |
| - cd ./image_generation/lcm_dreamshaper_v7/cpp/build/ |
46 |
| - ./lcm_dreamshaper |
| 67 | + working-directory: ${{ env.working_directory }} |
| 68 | + run: ./build/lcm_dreamshaper |
| 69 | + |
47 | 70 | lcm_dreamshaper_v7_cpp-windows:
|
48 |
| - runs-on: windows-latest |
49 |
| - steps: |
50 |
| - - uses: actions/checkout@v4 |
51 |
| - with: |
52 |
| - submodules: recursive |
53 |
| - - uses: actions/setup-python@v4 |
54 |
| - with: |
55 |
| - python-version: 3.8 |
56 |
| - - name: Initialize OpenVINO |
57 |
| - shell: cmd |
58 |
| - run: | |
59 |
| - curl --output ov.zip https://storage.openvinotoolkit.org/repositories/openvino/packages/nightly/2024.1.0-14645-e6dc0865128/w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64.zip |
60 |
| - unzip ov.zip |
61 |
| - - name: Download / convert a model / tokenizer |
62 |
| - shell: cmd |
63 |
| - run: | |
64 |
| - call w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64/setupvars.bat |
65 |
| - cd ./image_generation/lcm_dreamshaper_v7/cpp/scripts/ |
66 |
| - python -m pip install -r ./requirements.txt |
67 |
| - python -m pip install ../../../../thirdparty/openvino_tokenizers/ |
68 |
| - python convert_model.py -lcm "SimianLuo/LCM_Dreamshaper_v7" -t "FP16" |
69 |
| - - name: Build app |
70 |
| - shell: cmd |
71 |
| - run: | |
72 |
| - call w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64/setupvars.bat |
73 |
| - cd ./image_generation/lcm_dreamshaper_v7/cpp/ |
74 |
| - cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ |
75 |
| - cmake --build ./build/ --config Release --parallel |
76 |
| - - name: Run app |
77 |
| - shell: cmd |
78 |
| - run: | |
79 |
| - call w_openvino_toolkit_windows_2024.1.0.dev20240304_x86_64/setupvars.bat |
80 |
| - cd ./image_generation/lcm_dreamshaper_v7/cpp/build/ |
81 |
| - call "./Release/lcm_dreamshaper.exe" |
| 71 | + runs-on: windows-latest |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v4 |
| 74 | + with: |
| 75 | + submodules: recursive |
| 76 | + |
| 77 | + - name: Setup conda |
| 78 | + uses: conda-incubator/setup-miniconda@v3 |
| 79 | + with: |
| 80 | + miniconda-version: "latest" |
| 81 | + activate-environment: openvino_lcm_cpp |
| 82 | + python-version: "3.10" |
| 83 | + |
| 84 | + - name: Install OpenVINO and other conda dependencies |
| 85 | + run: | |
| 86 | + conda activate openvino_lcm_cpp |
| 87 | + conda update -c conda-forge --all |
| 88 | + conda install -c conda-forge openvino=2024.1.0 c-compiler cxx-compiler git make cmake |
| 89 | + conda env config vars set LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH |
| 90 | + |
| 91 | + - name: Install python dependencies |
| 92 | + working-directory: ${{ env.working_directory }} |
| 93 | + run: | |
| 94 | + conda activate openvino_lcm_cpp |
| 95 | + python -m pip install -r requirements.txt |
| 96 | + python -m pip install ../../../thirdparty/openvino_tokenizers/[transformers] |
| 97 | +
|
| 98 | + - name: Download and convert model and tokenizer |
| 99 | + working-directory: ${{ env.working_directory }} |
| 100 | + run: | |
| 101 | + conda activate openvino_lcm_cpp |
| 102 | + optimum-cli export openvino --model SimianLuo/LCM_Dreamshaper_v7 --weight-format fp16 models/lcm_dreamshaper_v7/FP16 |
| 103 | + |
| 104 | + - name: Build app |
| 105 | + working-directory: ${{ env.working_directory }} |
| 106 | + run: | |
| 107 | + conda activate openvino_lcm_cpp |
| 108 | + cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ |
| 109 | + cmake --build ./build/ --config Release --parallel |
| 110 | + |
| 111 | + - name: Run app |
| 112 | + working-directory: ${{ env.working_directory }} |
| 113 | + run: '& "./build/Release/lcm_dreamshaper.exe" -r --dynamic' |
0 commit comments