commit 129288b5bf1a57616a7fa325c958a7892ebcbf0d
parent d04fa0ca76e30c2f558f2208b36d8542e9c0290b
Author: Steven Atkinson <[email protected]>
Date: Thu, 12 Sep 2024 08:23:47 -0700
Rename `v3_0_0.wav` to `input.wav` (#459)
* Rename v3_0_0.wav to input.wav
* Check for other_name
Diffstat:
4 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/nam/train/_names.py b/nam/train/_names.py
@@ -2,7 +2,7 @@
# Created Date: Monday November 6th 2023
# Author: Steven Atkinson ([email protected])
-from typing import NamedTuple
+from typing import NamedTuple, Optional, Set
from ._version import PROTEUS_VERSION, Version
@@ -12,15 +12,16 @@ __all__ = ["INPUT_BASENAMES", "LATEST_VERSION", "VersionAndName"]
class VersionAndName(NamedTuple):
version: Version
name: str
+ other_names: Optional[Set[str]]
# From most- to the least-recently-released:
INPUT_BASENAMES = (
- VersionAndName(Version(3, 0, 0), "v3_0_0.wav"),
- VersionAndName(Version(2, 0, 0), "v2_0_0.wav"),
- VersionAndName(Version(1, 1, 1), "v1_1_1.wav"),
- VersionAndName(Version(1, 0, 0), "v1.wav"),
- VersionAndName(PROTEUS_VERSION, "Proteus_Capture.wav"),
+ VersionAndName(Version(3, 0, 0), "input.wav", {"v3_0_0.wav"}),
+ VersionAndName(Version(2, 0, 0), "v2_0_0.wav", None),
+ VersionAndName(Version(1, 1, 1), "v1_1_1.wav", None),
+ VersionAndName(Version(1, 0, 0), "v1.wav", None),
+ VersionAndName(PROTEUS_VERSION, "Proteus_Capture.wav", None),
)
LATEST_VERSION = INPUT_BASENAMES[0]
diff --git a/nam/train/_version.py b/nam/train/_version.py
@@ -6,8 +6,6 @@
Version utility
"""
-__all__ = ["PROTEUS_VERSION", "Version"]
-
class Version:
def __init__(self, major: int, minor: int, patch: int):
diff --git a/nam/train/colab.py b/nam/train/colab.py
@@ -34,7 +34,7 @@ def _check_for_files() -> Tuple[Version, str]:
raise RuntimeError(
f"Detected input signal {name} that has known bugs. Please download the latest input signal, {LATEST_VERSION[1]}"
)
- for input_version, input_basename in INPUT_BASENAMES:
+ for input_version, input_basename, other_names in INPUT_BASENAMES:
if Path(input_basename).exists():
if input_version == PROTEUS_VERSION:
print(f"Using Proteus input file...")
@@ -45,10 +45,17 @@ def _check_for_files() -> Tuple[Version, str]:
f"{LATEST_VERSION.name}."
)
break
+ if other_names is not None:
+ for other_name in other_names:
+ if Path(other_name).exists():
+ raise RuntimeError(
+ f"Found out-of-date input file {other_name}. Rename it to {input_basename} and re-run."
+ )
else:
raise FileNotFoundError(
f"Didn't find NAM's input audio file. Please upload {LATEST_VERSION.name}"
)
+ # We found it
if not Path(_OUTPUT_BASENAME).exists():
raise FileNotFoundError(
f"Didn't find your reamped output audio file. Please upload {_OUTPUT_BASENAME}."
diff --git a/nam/train/gui/__init__.py b/nam/train/gui/__init__.py
@@ -214,6 +214,7 @@ class _InputPathButton(_PathButton):
@classmethod
def _download_input_file(cls):
file_urls = {
+ "input.wav": "https://drive.google.com/file/d/1KbaS4oXXNEuh2aCPLwKrPdf5KFOjda8G/view?usp=drive_link",
"v3_0_0.wav": "https://drive.google.com/file/d/1Pgf8PdE0rKB1TD4TRPKbpNo1ByR3IOm9/view?usp=drive_link",
"v2_0_0.wav": "https://drive.google.com/file/d/1xnyJP_IZ7NuyDSTJfn-Jmc5lw0IE7nfu/view?usp=drive_link",
"v1_1_1.wav": "",