From 21107ef5eff760e0475138cca6d20585f27190db Mon Sep 17 00:00:00 2001 From: Oliver Koenig Date: Fri, 12 Jul 2024 12:10:53 +0200 Subject: [PATCH] refactor: Uniform BRANCH for notebooks Signed-off-by: Oliver Koenig --- tutorials/asr/Confidence_Ensembles.ipynb | 2 +- .../Speech_Enhancement_with_NeMo.ipynb | 13 +++++++------ .../nlp/Token_Classification-BioMegatron.ipynb | 2 +- tutorials/nlp/lora.ipynb | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tutorials/asr/Confidence_Ensembles.ipynb b/tutorials/asr/Confidence_Ensembles.ipynb index 9bab06dd2976..734ddc9a0604 100644 --- a/tutorials/asr/Confidence_Ensembles.ipynb +++ b/tutorials/asr/Confidence_Ensembles.ipynb @@ -39,7 +39,7 @@ "\n", "# option #2: download NeMo repo\n", "if 'google.colab' in str(get_ipython()) or not os.path.exists(os.path.join(NEMO_DIR, \"nemo\")):\n", - " BRANCH = \"main\"\n", + " BRANCH = 'main'\n", " !git clone -b $BRANCH https://github.com/NVIDIA/NeMo $WORKSPACE_DIR/NeMo\n", " NEMO_DIR = os.path.join(WORKSPACE_DIR, 'NeMo')\n", "\n", diff --git a/tutorials/audio/speech_enhancement/Speech_Enhancement_with_NeMo.ipynb b/tutorials/audio/speech_enhancement/Speech_Enhancement_with_NeMo.ipynb index ffd630824bdb..5c697840ba09 100644 --- a/tutorials/audio/speech_enhancement/Speech_Enhancement_with_NeMo.ipynb +++ b/tutorials/audio/speech_enhancement/Speech_Enhancement_with_NeMo.ipynb @@ -45,7 +45,8 @@ "5. Restart the runtime (Runtime -> Restart Runtime) for any upgraded packages to take effect\n", "\"\"\"\n", "\n", - "GIT_USER, GIT_BRANCH = 'NVIDIA', 'main'\n", + "GIT_USER = 'NVIDIA'\n", + "BRANCH = 'main'\n", "\n", "if 'google.colab' in str(get_ipython()):\n", "\n", @@ -56,7 +57,7 @@ " !pip install matplotlib>=3.3.2\n", "\n", " ## Install NeMo\n", - " !python -m pip install git+https://github.com/{GIT_USER}/NeMo.git@{GIT_BRANCH}#egg=nemo_toolkit[all]\n", + " !python -m pip install git+https://github.com/{GIT_USER}/NeMo.git@{BRANCH}#egg=nemo_toolkit[all]\n", "\n", " ## Install TorchAudio\n", " !pip install torchaudio>=0.13.0 -f https://download.pytorch.org/whl/torch_stable.html" @@ -210,7 +211,7 @@ "# Copy script\n", "get_librispeech_script = os.path.join(scripts_dir, 'get_librispeech_data.py')\n", "if not os.path.exists(get_librispeech_script):\n", - " !wget -P $scripts_dir https://raw.githubusercontent.com/{GIT_USER}/NeMo/{GIT_BRANCH}/scripts/dataset_processing/get_librispeech_data.py\n", + " !wget -P $scripts_dir https://raw.githubusercontent.com/{GIT_USER}/NeMo/{BRANCH}/scripts/dataset_processing/get_librispeech_data.py\n", "\n", "# Download the data\n", "if not speech_dir.is_dir():\n", @@ -260,7 +261,7 @@ "# Copy script\n", "get_demand_script = os.path.join(scripts_dir, 'get_demand_data.py')\n", "if not os.path.exists(get_demand_script):\n", - " !wget -P $scripts_dir https://raw.githubusercontent.com/{GIT_USER}/NeMo/{GIT_BRANCH}/scripts/dataset_processing/get_demand_data.py\n", + " !wget -P $scripts_dir https://raw.githubusercontent.com/{GIT_USER}/NeMo/{BRANCH}/scripts/dataset_processing/get_demand_data.py\n", "\n", "if not noise_dir.is_dir():\n", " noise_dir.mkdir(exist_ok=True)\n", @@ -323,7 +324,7 @@ "# Copy script\n", "add_noise_script = os.path.join(scripts_dir, 'add_noise.py')\n", "if not os.path.exists(add_noise_script):\n", - " !wget -P $scripts_dir https://raw.githubusercontent.com/{GIT_USER}/NeMo/{GIT_BRANCH}/scripts/dataset_processing/add_noise.py\n", + " !wget -P $scripts_dir https://raw.githubusercontent.com/{GIT_USER}/NeMo/{BRANCH}/scripts/dataset_processing/add_noise.py\n", "\n", "# Generate noisy datasets and save the noise component as well.\n", "noisy_dir = data_dir / 'noisy'\n", @@ -494,7 +495,7 @@ "config_path = config_dir / 'masking.yaml'\n", "\n", "if not config_path.is_file():\n", - " !wget https://raw.githubusercontent.com/{GIT_USER}/NeMo/{GIT_BRANCH}/examples/audio/conf/masking.yaml -P {config_dir.as_posix()}\n", + " !wget https://raw.githubusercontent.com/{GIT_USER}/NeMo/{BRANCH}/examples/audio/conf/masking.yaml -P {config_dir.as_posix()}\n", "\n", "config = OmegaConf.load(config_path)\n", "config = OmegaConf.to_container(config, resolve=True)\n", diff --git a/tutorials/nlp/Token_Classification-BioMegatron.ipynb b/tutorials/nlp/Token_Classification-BioMegatron.ipynb index afbc8394aa84..85cb769b28c0 100644 --- a/tutorials/nlp/Token_Classification-BioMegatron.ipynb +++ b/tutorials/nlp/Token_Classification-BioMegatron.ipynb @@ -7,7 +7,7 @@ "metadata": {}, "outputs": [], "source": [ - "BRANCH='main'" + "BRANCH = 'main'" ] }, { diff --git a/tutorials/nlp/lora.ipynb b/tutorials/nlp/lora.ipynb index 1dba69ff3629..b878b9cfe453 100644 --- a/tutorials/nlp/lora.ipynb +++ b/tutorials/nlp/lora.ipynb @@ -31,7 +31,7 @@ "outputs": [], "source": [ "%cd /NeMo/tutorials/nlp\n", - "BRANCH='main'\n", + "BRANCH = 'main'\n", "import os\n", "import wget\n", "import sys\n",