fabiogra commited on
Commit
e3a6fa0
1 Parent(s): e2f0346

fix: prepare samples script

Browse files
Files changed (1) hide show
  1. scripts/prepare_samples.sh +5 -5
scripts/prepare_samples.sh CHANGED
@@ -1,14 +1,16 @@
1
  #!/bin/bash
2
 
3
- # Check if the "DISABLE_SAMPLES" environment variable is set
4
- if [ -n "${DISABLE_SAMPLES}" ]; then
5
- echo "DISABLE_SAMPLES is set. Skipping sample preparation."
6
  exit 0
7
  fi
8
 
9
  # Read JSON file into a variable
10
  json=$(cat sample_songs.json)
11
 
 
 
12
  # Iterate through keys and values
13
  for name in $(echo "${json}" | jq -r 'keys[]'); do
14
  url=$(echo "${json}" | jq -r --arg name "${name}" '.[$name]')
@@ -16,7 +18,6 @@ for name in $(echo "${json}" | jq -r 'keys[]'); do
16
 
17
  # Download with pytube
18
  yt-dlp ${url} -o "/tmp/${name}" --format "bestaudio/best"
19
- mkdir -p "/tmp/vocal_remover"
20
 
21
  # Run inference
22
  python inference.py --input /tmp/${name} --output /tmp
@@ -34,7 +35,6 @@ for name in $(echo "${json_separate}" | jq -r 'keys[]'); do
34
 
35
  # Download with pytube
36
  yt-dlp ${url} -o "/tmp/${name}" --format "bestaudio/best" --download-sections "*45-110"
37
- mkdir -p "/tmp/vocal_remover"
38
 
39
  # Run inference
40
  python inference.py --input /tmp/${name} --output /tmp --only_no_vocals false
 
1
  #!/bin/bash
2
 
3
+ # Check if the "PREPARE_SAMPLES" environment variable is set
4
+ if [ -z "${PREPARE_SAMPLES}" ]; then
5
+ echo "PREPARE_SAMPLES is unset or set to the empty string. Skipping sample preparation."
6
  exit 0
7
  fi
8
 
9
  # Read JSON file into a variable
10
  json=$(cat sample_songs.json)
11
 
12
+ mkdir -p "/tmp/vocal_remover"
13
+
14
  # Iterate through keys and values
15
  for name in $(echo "${json}" | jq -r 'keys[]'); do
16
  url=$(echo "${json}" | jq -r --arg name "${name}" '.[$name]')
 
18
 
19
  # Download with pytube
20
  yt-dlp ${url} -o "/tmp/${name}" --format "bestaudio/best"
 
21
 
22
  # Run inference
23
  python inference.py --input /tmp/${name} --output /tmp
 
35
 
36
  # Download with pytube
37
  yt-dlp ${url} -o "/tmp/${name}" --format "bestaudio/best" --download-sections "*45-110"
 
38
 
39
  # Run inference
40
  python inference.py --input /tmp/${name} --output /tmp --only_no_vocals false