@@ -6,6 +6,7 @@ import { AUDIO_SAMPLE_RATE } from "./lib/audio/constants";
66import { decodeAudioFile } from "./lib/audio/decode" ;
77import {
88 isModelFilename ,
9+ modelAssetUrl ,
910 requiredModelFiles ,
1011 type ModelArtifact ,
1112 type ModelFilename ,
@@ -360,16 +361,7 @@ export function App() {
360361 3. Add models
361362 </ h2 >
362363 < p className = "text-muted mb-5.5 leading-relaxed" >
363- Download model assets from the{ " " }
364- < a
365- className = "text-primary hover:text-accent font-semibold underline underline-offset-3"
366- href = "https://github.com/hi-ogawa/demucs-onnx/releases"
367- target = "_blank"
368- rel = "noreferrer"
369- >
370- GitHub Releases page
371- </ a >
372- , then select the required files.
364+ Download each required model, then select the downloaded file.
373365 </ p >
374366 < div className = "grid gap-2.5" >
375367 { requiredFiles . map ( ( filename ) => (
@@ -496,8 +488,8 @@ function ModelFileSlot({
496488} ) {
497489 return (
498490 < div data-testid = "model-file-slot" >
499- < label
500- className = { `flex min-h-13 cursor-pointer items-center gap-3 rounded-md border px-4 py-3 transition-colors ${
491+ < div
492+ className = { `flex min-h-13 items-center gap-3 rounded-md border px-4 py-3 transition-colors ${
501493 ready
502494 ? "border-success-border bg-success-surface hover:bg-success-surface-hover"
503495 : "border-border-strong bg-surface-muted hover:border-drop-border-hover hover:bg-drop-surface-hover border-dashed"
@@ -516,20 +508,26 @@ function ModelFileSlot({
516508 < code className = "text-foreground min-w-0 flex-1 overflow-hidden text-sm font-semibold text-ellipsis" >
517509 { filename }
518510 </ code >
519- < span className = "text-primary-strong shrink-0 text-sm font-bold" >
511+ < a
512+ className = "text-primary hover:text-accent shrink-0 text-sm font-semibold underline underline-offset-3"
513+ href = { modelAssetUrl ( filename ) }
514+ >
515+ Download
516+ </ a >
517+ < label className = "text-primary-strong shrink-0 cursor-pointer text-sm font-bold" >
520518 { ready ? "Ready" : "Choose file" }
521- </ span >
522- < input
523- className = "sr-only "
524- type = "file"
525- aria-label = { `Select ${ filename } ` }
526- accept = { filename . endsWith ( ".onnx" ) ? ".onnx" : ".bin" }
527- onChange = { ( event ) => {
528- onSelect ( [ ... ( event . target . files ?? [ ] ) ] ) ;
529- event . target . value = "" ;
530- } }
531- / >
532- </ label >
519+ < input
520+ className = "sr-only"
521+ type = "file "
522+ aria-label = { `Select ${ filename } ` }
523+ accept = { filename . endsWith ( ".onnx" ) ? ".onnx" : ".bin" }
524+ onChange = { ( event ) => {
525+ onSelect ( [ ... ( event . target . files ?? [ ] ) ] ) ;
526+ event . target . value = "" ;
527+ } }
528+ />
529+ </ label >
530+ </ div >
533531 { error && < p className = "text-danger mt-1.5 text-sm" > { error } </ p > }
534532 </ div >
535533 ) ;
0 commit comments