Spaces:
Running on Zero
Running on Zero
Commit ·
45a4784
1
Parent(s): 491b8c9
Swap demo to Track0000 — my own unfinished song from 2016
Browse filesReplace the placeholder demo clip with Track0000, the song I recorded in
2016 and never finished — the exact kind of clip CODA exists to finish, and
the emotional core of the project. Update the demo button + footer to tell
that story; remove the old placeholder. Bundled via Git LFS.
app.py
CHANGED
|
@@ -45,12 +45,11 @@ except ImportError:
|
|
| 45 |
return fn if fn else (lambda f: f)
|
| 46 |
spaces = _FakeSpaces()
|
| 47 |
|
| 48 |
-
# bundled demo:
|
| 49 |
-
#
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
"Bring your own clip to finish your own song.")
|
| 54 |
|
| 55 |
# total finished length. SA3 Small generates up to 120 s in one call, so this is
|
| 56 |
# a *total length* control (clip + continuation), not a "seconds to add" knob.
|
|
@@ -211,7 +210,7 @@ def finish_song(audio_path, total_seconds, vibe, remaster,
|
|
| 211 |
|
| 212 |
Yields/returns 3-tuples for (output_audio, summary_md, stage_html)."""
|
| 213 |
if not audio_path:
|
| 214 |
-
raise gr.Error("Upload a clip (or load the
|
| 215 |
|
| 216 |
total_seconds = int(total_seconds)
|
| 217 |
try:
|
|
@@ -271,15 +270,15 @@ def finish_song(audio_path, total_seconds, vibe, remaster,
|
|
| 271 |
|
| 272 |
|
| 273 |
def load_demo():
|
| 274 |
-
"""Load the
|
| 275 |
|
| 276 |
Copy the bundled clip to a fresh temp file and hand THAT to the uploader.
|
| 277 |
Gradio 6 refuses to move a non-user-uploaded bundled file into its cache
|
| 278 |
("…was not uploaded by a user"), which broke the demo on the Space; a file
|
| 279 |
in a per-request temp dir is one Gradio will cache and serve normally."""
|
| 280 |
import shutil
|
| 281 |
-
dst = os.path.join(tempfile.mkdtemp(), os.path.basename(
|
| 282 |
-
shutil.copyfile(
|
| 283 |
return dst
|
| 284 |
|
| 285 |
|
|
@@ -998,7 +997,7 @@ with gr.Blocks(title="CODA") as app:
|
|
| 998 |
waveform_color="#33405e",
|
| 999 |
waveform_progress_color="#6fe0f5",
|
| 1000 |
trim_region_color="#a98bff"))
|
| 1001 |
-
demo_btn = gr.Button("🎧
|
| 1002 |
size="sm", elem_classes="coda-demo")
|
| 1003 |
total_slider = gr.Slider(
|
| 1004 |
MIN_TOTAL, MAX_TOTAL, value=DEFAULT_TOTAL, step=1,
|
|
@@ -1057,8 +1056,9 @@ with gr.Blocks(title="CODA") as app:
|
|
| 1057 |
summary_md = gr.Markdown(elem_classes="coda-summary")
|
| 1058 |
|
| 1059 |
gr.HTML(
|
| 1060 |
-
"<div id='coda-foot'>Demo clip: <strong>
|
| 1061 |
-
"
|
|
|
|
| 1062 |
"<br/><span class='coda-badge'>Stable Audio 3 · ZeroGPU · 44.1 kHz "
|
| 1063 |
"stereo</span></div>")
|
| 1064 |
|
|
|
|
| 45 |
return fn if fn else (lambda f: f)
|
| 46 |
spaces = _FakeSpaces()
|
| 47 |
|
| 48 |
+
# bundled demo: "Track0000" — Tony Winslow's own song, recorded in 2016 and
|
| 49 |
+
# never finished. The emotional core of CODA: the exact kind of clip this tool
|
| 50 |
+
# exists to finish. lo-fi in, finished-sounding out.
|
| 51 |
+
DEMO_CLIP = os.path.join(os.path.dirname(__file__),
|
| 52 |
+
"examples", "track0000_tony_winslow.mp3")
|
|
|
|
| 53 |
|
| 54 |
# total finished length. SA3 Small generates up to 120 s in one call, so this is
|
| 55 |
# a *total length* control (clip + continuation), not a "seconds to add" knob.
|
|
|
|
| 210 |
|
| 211 |
Yields/returns 3-tuples for (output_audio, summary_md, stage_html)."""
|
| 212 |
if not audio_path:
|
| 213 |
+
raise gr.Error("Upload a clip (or load the Track0000 demo) first.")
|
| 214 |
|
| 215 |
total_seconds = int(total_seconds)
|
| 216 |
try:
|
|
|
|
| 270 |
|
| 271 |
|
| 272 |
def load_demo():
|
| 273 |
+
"""Load the Track0000 demo clip into the uploader.
|
| 274 |
|
| 275 |
Copy the bundled clip to a fresh temp file and hand THAT to the uploader.
|
| 276 |
Gradio 6 refuses to move a non-user-uploaded bundled file into its cache
|
| 277 |
("…was not uploaded by a user"), which broke the demo on the Space; a file
|
| 278 |
in a per-request temp dir is one Gradio will cache and serve normally."""
|
| 279 |
import shutil
|
| 280 |
+
dst = os.path.join(tempfile.mkdtemp(), os.path.basename(DEMO_CLIP))
|
| 281 |
+
shutil.copyfile(DEMO_CLIP, dst)
|
| 282 |
return dst
|
| 283 |
|
| 284 |
|
|
|
|
| 997 |
waveform_color="#33405e",
|
| 998 |
waveform_progress_color="#6fe0f5",
|
| 999 |
trim_region_color="#a98bff"))
|
| 1000 |
+
demo_btn = gr.Button("🎧 Hear Track0000 — recorded 2016, never finished",
|
| 1001 |
size="sm", elem_classes="coda-demo")
|
| 1002 |
total_slider = gr.Slider(
|
| 1003 |
MIN_TOTAL, MAX_TOTAL, value=DEFAULT_TOTAL, step=1,
|
|
|
|
| 1056 |
summary_md = gr.Markdown(elem_classes="coda-summary")
|
| 1057 |
|
| 1058 |
gr.HTML(
|
| 1059 |
+
"<div id='coda-foot'>Demo clip: <strong>Track0000</strong> — recorded "
|
| 1060 |
+
"2016, never finished. Tony Winslow's own unfinished song, the kind CODA "
|
| 1061 |
+
"exists to finish. Bring your own clip to finish yours."
|
| 1062 |
"<br/><span class='coda-badge'>Stable Audio 3 · ZeroGPU · 44.1 kHz "
|
| 1063 |
"stereo</span></div>")
|
| 1064 |
|
examples/{pushback_demo.mp3 → track0000_tony_winslow.mp3}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:500c87290a8d20e67bdbdb37747327d04d331e80140633020ec1fa3e6d431c28
|
| 3 |
+
size 413823
|