fabiogra
commited on
Commit
·
bce9fad
1
Parent(s):
2849148
fix: replace PREPARE_SAMPLES env var with DISABLE_SAMPLES
Browse files- Dockerfile +1 -1
- README.md +1 -1
- app/helpers.py +2 -4
- scripts/prepare_samples.sh +3 -5
Dockerfile
CHANGED
|
@@ -14,7 +14,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 14 |
|
| 15 |
COPY scripts/ .
|
| 16 |
COPY app ./app
|
| 17 |
-
|
| 18 |
|
| 19 |
RUN wget --progress=bar:force:noscroll https://huggingface.co/fabiogra/baseline_vocal_remover/resolve/main/baseline.pth
|
| 20 |
|
|
|
|
| 14 |
|
| 15 |
COPY scripts/ .
|
| 16 |
COPY app ./app
|
| 17 |
+
COPY img ./img
|
| 18 |
|
| 19 |
RUN wget --progress=bar:force:noscroll https://huggingface.co/fabiogra/baseline_vocal_remover/resolve/main/baseline.pth
|
| 20 |
|
README.md
CHANGED
|
@@ -76,7 +76,7 @@ You can set the following environment variables to limit the resources used by t
|
|
| 76 |
- ENV_LIMITATION=true
|
| 77 |
- LIMIT_CPU=true
|
| 78 |
|
| 79 |
-
If you want to use
|
| 80 |
|
| 81 |
---
|
| 82 |
## About
|
|
|
|
| 76 |
- ENV_LIMITATION=true
|
| 77 |
- LIMIT_CPU=true
|
| 78 |
|
| 79 |
+
If you want to use disable the processing the samples used in the demo, you need to set the env variable `DISABLE_SAMPLES=true`
|
| 80 |
|
| 81 |
---
|
| 82 |
## About
|
app/helpers.py
CHANGED
|
@@ -66,12 +66,10 @@ def plot_audio(_audio_segment: AudioSegment, *args, **kwargs) -> Image.Image:
|
|
| 66 |
|
| 67 |
@st.cache_data(show_spinner=False)
|
| 68 |
def load_list_of_songs(path="sample_songs.json"):
|
| 69 |
-
if os.environ.get("
|
| 70 |
return json.load(open(path))
|
| 71 |
else:
|
| 72 |
-
st.error(
|
| 73 |
-
"No examples available. You need to set the environment variable `PREPARE_SAMPLES=true`"
|
| 74 |
-
)
|
| 75 |
|
| 76 |
|
| 77 |
def get_random_song():
|
|
|
|
| 66 |
|
| 67 |
@st.cache_data(show_spinner=False)
|
| 68 |
def load_list_of_songs(path="sample_songs.json"):
|
| 69 |
+
if os.environ.get("DISABLE_SAMPLES") is None:
|
| 70 |
return json.load(open(path))
|
| 71 |
else:
|
| 72 |
+
st.error("`DISABLE_SAMPLES` is set. No examples available.")
|
|
|
|
|
|
|
| 73 |
|
| 74 |
|
| 75 |
def get_random_song():
|
scripts/prepare_samples.sh
CHANGED
|
@@ -1,10 +1,8 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
# Check if the "
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
if [ "$output" -eq "0" ]; then
|
| 7 |
-
echo "PREPARE_SAMPLES is unset or set to the empty string. Skipping sample preparation."
|
| 8 |
exit 0
|
| 9 |
fi
|
| 10 |
|
|
|
|
| 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 |
|