-
Notifications
You must be signed in to change notification settings - Fork 10
210 lines (168 loc) · 7.23 KB
/
test-ace-generation.yml
File metadata and controls
210 lines (168 loc) · 7.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: ACE-Step Generation Test
on:
pull_request:
branches: [ main, develop ]
workflow_dispatch:
permissions:
contents: read
jobs:
test-ace-generation:
name: Test ACE-Step Generation End-to-End
runs-on: macos-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Display Python version
run: python --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_ace_macos.txt
- name: Install audio-separator (no deps)
run: |
pip install "audio-separator==0.40.0" --no-deps
- name: Install py3langid (no deps)
run: |
pip install "py3langid==0.3.0" --no-deps
- name: Install ACE-Step (no deps)
run: |
pip install "git+https://github.com/ace-step/ACE-Step.git" --no-deps
- name: Verify ACE-Step import
run: |
python -c "
import sys
print('Testing ACE-Step imports...')
# Test basic import
import acestep
print(f'✓ acestep package imported')
# Test submodule imports (what's needed by cdmf_pipeline_ace_step.py)
from acestep.schedulers.scheduling_flow_match_euler_discrete import FlowMatchEulerDiscreteScheduler
print(f'✓ FlowMatchEulerDiscreteScheduler imported')
from acestep.schedulers.scheduling_flow_match_heun_discrete import FlowMatchHeunDiscreteScheduler
print(f'✓ FlowMatchHeunDiscreteScheduler imported')
from acestep.schedulers.scheduling_flow_match_pingpong import FlowMatchPingPongScheduler
print(f'✓ FlowMatchPingPongScheduler imported')
from acestep.language_segmentation import LangSegment, language_filters
print(f'✓ LangSegment and language_filters imported')
from acestep.music_dcae.music_dcae_pipeline import MusicDCAE
print(f'✓ MusicDCAE imported')
from acestep.models.ace_step_transformer import ACEStepTransformer2DModel
print(f'✓ ACEStepTransformer2DModel imported')
from acestep.models.lyrics_utils.lyric_tokenizer import VoiceBpeTokenizer
print(f'✓ VoiceBpeTokenizer imported')
from acestep.apg_guidance import apg_forward, MomentumBuffer
print(f'✓ apg_forward and MomentumBuffer imported')
from acestep.cpu_offload import cpu_offload
print(f'✓ cpu_offload imported')
print('✓ All ACE-Step imports successful!')
"
- name: Test cdmf_pipeline_ace_step.py import
run: |
python -c "
print('Testing cdmf_pipeline_ace_step.py import...')
from cdmf_pipeline_ace_step import ACEStepPipeline
print(f'✓ ACEStepPipeline class imported successfully')
print(f'✓ ACEStepPipeline type: {type(ACEStepPipeline)}')
"
- name: Download ACE-Step models
run: |
echo "Downloading ACE-Step models..."
python ace_model_setup.py
- name: Verify models downloaded
run: |
python -c "
from pathlib import Path
import sys
from ace_model_setup import ACE_LOCAL_DIRNAME, get_ace_checkpoint_root
# Get the actual checkpoint root directory (platform-aware)
checkpoint_root = get_ace_checkpoint_root()
print(f'Checking for models in: {checkpoint_root}')
# Check if models directory exists
if not checkpoint_root.exists():
print(f'✗ Models directory does not exist at {checkpoint_root}')
sys.exit(1)
print(f'✓ Models directory exists at {checkpoint_root}')
# Find the downloaded model repo directory (using ACE_LOCAL_DIRNAME from ace_model_setup.py)
ace_repo_dir = checkpoint_root / ACE_LOCAL_DIRNAME
if not ace_repo_dir.exists():
print(f'✗ ACE-Step model directory not found at {ace_repo_dir}')
sys.exit(1)
print(f'✓ Found ACE-Step model directory: {ace_repo_dir}')
# Check for required model subdirectories inside the repo directory
required_dirs = ['music_dcae_f8c8', 'music_vocoder', 'ace_step_transformer', 'umt5-base']
all_exist = True
for dir_name in required_dirs:
dir_path = ace_repo_dir / dir_name
if dir_path.exists():
print(f'✓ {dir_name} directory exists')
else:
print(f'✗ {dir_name} directory missing in {ace_repo_dir}')
all_exist = False
if not all_exist:
print('✗ Not all required model directories exist')
sys.exit(1)
print('✓ All required model directories exist')
"
- name: Set Environment Variables for Lower Memory Usage
run: |
echo "PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0" >> $GITHUB_ENV
echo "Set PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0"
- name: Verify Environment Variable is Set
run: |
echo "PYTORCH_MPS_HIGH_WATERMARK_RATIO=${PYTORCH_MPS_HIGH_WATERMARK_RATIO}"
if [ -z "$PYTORCH_MPS_HIGH_WATERMARK_RATIO" ]; then
echo "ERROR: PYTORCH_MPS_HIGH_WATERMARK_RATIO is not set!"
exit 1
fi
- name: Run minimal generation test (10 seconds, instrumental)
run: |
echo "Running minimal ACE-Step generation test..."
python generate_ace.py \
--genre-prompt "upbeat electronic music, synthwave" \
--instrumental \
--seconds 10 \
--steps 5 \
--guidance 4.0 \
--seed 42 \
--out-dir test_output \
--basename "ci_test_track"
- name: Verify output file was created
run: |
python -c "
from pathlib import Path
import sys
# Check if output directory exists
output_dir = Path('test_output')
if not output_dir.exists():
print('✗ Output directory does not exist')
sys.exit(1)
# Find WAV files
wav_files = list(output_dir.glob('*.wav'))
if not wav_files:
print('✗ No WAV files found in output directory')
sys.exit(1)
# Check file size (should be > 0)
MIN_10SEC_AUDIO_SIZE_BYTES = 100_000 # Minimum expected size for 10-second audio
for wav_file in wav_files:
size = wav_file.stat().st_size
print(f'✓ Generated file: {wav_file.name} ({size:,} bytes)')
if size == 0:
print(f'✗ File is empty')
sys.exit(1)
if size < MIN_10SEC_AUDIO_SIZE_BYTES:
print(f'✗ File seems too small for 10 seconds of audio')
sys.exit(1)
print('✓ Generation test successful - output file created and non-empty')
"
- name: Upload test output as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ace-generation-test-output
path: test_output/
retention-days: 7