Skip to content

Commit 1fe8763

Browse files
fix issues with pitch extracting using full crepe method
1 parent 0206dc5 commit 1fe8763

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

notes/TODO.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# TODO
22

3+
* num threads has been hardcoded to be 1 for crepe as it fails with multiple threads. But this is not reflected in documentation for core API and CLI and UI still shows slider for number of threads. Consider whether we need to update documentation and or have UI disable slider and set num threads to 1 when crepe is selected.
4+
35
* figure out a way of safely storing PyPI credentials
46
* promote dependencies to latest versions
57
* and do proper testing before committing

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "ultimate-rvc"
7-
version = "0.5.13"
7+
version = "0.5.15"
88
description = "Ultimate RVC"
99
readme = "README.md"
1010
requires-python = "==3.12.*"

src/ultimate_rvc/rvc/train/extract/extract.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ def run_pitch_extraction(
148148

149149
remove_sox_libmso6_from_ld_preload()
150150

151+
if f0_method == "crepe":
152+
actual_threads = 1 # crepe method cannot handle multiple threads
153+
logger.info(
154+
"crepe detected: using single-threaded processing (was %d threads). "
155+
"crepe requires single-threaded operation due to GPU limitations.",
156+
threads,
157+
)
158+
else:
159+
actual_threads = threads
151160
with concurrent.futures.ProcessPoolExecutor(max_workers=len(devices)) as executor:
152161
tasks = [
153162
executor.submit(
@@ -156,11 +165,12 @@ def run_pitch_extraction(
156165
f0_method,
157166
hop_length,
158167
devices[i],
159-
threads // len(devices),
168+
actual_threads // len(devices),
160169
)
161170
for i in range(len(devices))
162171
]
163-
concurrent.futures.wait(tasks)
172+
for future in concurrent.futures.as_completed(tasks):
173+
future.result() # Properly waits and propagates exceptions
164174

165175
logger.info("Pitch extraction completed in %.2f seconds.", time.time() - start_time)
166176

@@ -225,7 +235,8 @@ def run_embedding_extraction(
225235
)
226236
for i in range(len(devices))
227237
]
228-
concurrent.futures.wait(tasks)
238+
for future in concurrent.futures.as_completed(tasks):
239+
future.result() # Properly waits and propagates exceptions
229240
logger.info(
230241
"Embedding extraction completed in %.2f seconds.",
231242
time.time() - start_time,

0 commit comments

Comments
 (0)