forked from facebookresearch/demucs
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend torchaudio support to 2.1.x (#3)
* Update README.md * Update README.md * Update README.md * Update README.md * minor fixes for 4.1.0a1 (facebookresearch#552) * minor fixes for 4.1.0a1 print out the exception when calling callback ensures all threads can be stopped when interrupting separation add release data for 4.0.1 * Fix model_idx_in_bag always zero * fix linter * Fix can't separate empty audio * Calls callback when skipping empty audio * Add description for aborting * Does not ignore callback exception * Fix linter * Does not ignore exception * Disable torchaudio 2.2+ * Uses epsilon to deal with empty audio * Reraises exception in callback * Ensure the pool stops when encountering exception * Update windows.md for latest instructions * Minor documentation updates (facebookresearch#565) * Minor documentation updates * Update readme * Update api.md * Fix segment defined in bag can't override model * merge from adefossez/demucs * Update README.md * Extend torchaudio support to 2.1.x * Use correct import statement * Calculate FFT on CPU also when device is XPU (Intel GPU) --------- Co-authored-by: Alexandre Défossez <[email protected]> Co-authored-by: William Dye <[email protected]>
- Loading branch information
1 parent
a4decbd
commit b3398e4
Showing
11 changed files
with
39 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
|
||
import subprocess | ||
|
||
from . import audio_legacy | ||
import torch as th | ||
import torchaudio as ta | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This file is to extend support for torchaudio 2.1 | ||
|
||
import importlib | ||
import os | ||
import sys | ||
import warnings | ||
|
||
if not "torchaudio" in sys.modules: | ||
os.environ["TORCHAUDIO_USE_BACKEND_DISPATCHER"] = "0" | ||
elif os.getenv("TORCHAUDIO_USE_BACKEND_DISPATCHER", default="1") == "1": | ||
if sys.modules["torchaudio"].__version__ >= "2.1": | ||
os.environ["TORCHAUDIO_USE_BACKEND_DISPATCHER"] = "0" | ||
importlib.reload(sys.modules["torchaudio"]) | ||
warnings.warn( | ||
"TORCHAUDIO_USE_BACKEND_DISPATCHER is set to 0 and torchaudio is reloaded.", | ||
ImportWarning, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,5 @@ lameenc>=1.2 | |
openunmix | ||
pyyaml | ||
torch>=1.8.1 | ||
torchaudio>=0.8,<2.1 | ||
torchaudio>=0.8,<2.2 | ||
tqdm |