Spaces:
Sleeping
Sleeping
Update js/app.py
Browse files192 unmodified lines1931941951961971981992002012022032042052062072081 unmodified line210211212213214215216116 unmodified lines333334335336192 unmodified lineswav = load_audio_via_ffmpeg(input_path, model.samplerate)job.status = JobStatus.PROCESSINGjob.progress = 10def progress_callback(state):# apply_model calls this with a dict containing 'segment_offset'# and 'audio_length' we can use for a coarse progress estimate.try:frac = state.get("segment_offset", 0) / max(state.get("audio_length", 1), 1)job.progress = 10 + int(frac * 80) # 10-90% during inferenceexcept Exception:passwith torch.no_grad():sources = apply_model(1 unmodified linewav[None],device="cpu",progress=False,callback=progress_callback,split=True,overlap=0.25,)[0]116 unmodified linesmedia_type="audio/wav",filename=f"{stem}.wav",)192 unmodified lines1931941951961971981991 unmodified line201202203204205206116 unmodified lines323324325192 unmodified lineswav = load_audio_via_ffmpeg(input_path, model.samplerate)job.status = JobStatus.PROCESSINGjob.progress = 15with torch.no_grad():sources = apply_model(1 unmodified linewav[None],device="cpu",progress=False,split=True,overlap=0.25,)[0]116 unmodified linesmedia_type="audio/wav",filename=f"{stem}.wav",)
js/app.py+1-12