huggingface / candle

Minimalist ML framework for Rust
Apache License 2.0
15.31k stars 897 forks source link

Whisper example does not run #2502

Open dengelt opened 3 days ago

dengelt commented 3 days ago
USER@HOST:~/workspace/candle/candle-examples/examples/whisper$ cargo run --example whisper --release
error: target `whisper` in package `candle-examples` requires the features: `symphonia`
Consider enabling them by passing, e.g., `--features="symphonia"`
USER@HOST:~/workspace/candle/candle-examples/examples/whisper$ cargo run --example whisper --features=symphonia --release
    Finished release [optimized] target(s) in 0.13s
     Running `/home/USER/.cache/cargo-target/release/examples/whisper`
Running on CPU, to run on GPU, build this example with `--features cuda`
No audio file submitted: Downloading https://huggingface.co/datasets/Narsil/candle_demo/blob/main/samples_jfk.wav
Error: I/O error File exists (os error 17)

Caused by:
    File exists (os error 17)
USER@HOST:~/workspace/candle/candle-examples/examples/whisper$ RUST_BACKTRACE=1 cargo run --example whisper --features=symphonia
    Finished dev [unoptimized + debuginfo] target(s) in 0.14s
     Running `/home/USER/.cache/cargo-target/debug/examples/whisper`
Running on CPU, to run on GPU, build this example with `--features cuda`
No audio file submitted: Downloading https://huggingface.co/datasets/Narsil/candle_demo/blob/main/samples_jfk.wav
Error: I/O error File exists (os error 17)

Caused by:
    File exists (os error 17)

Stack backtrace:
   0: <core::result::Result<T,F> as core::ops::try_trait::FromResidual<core::result::Result<core::convert::Infallible,E>>>::from_residual
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/core/src/result.rs:1959:27
   1: whisper::main
             at ./main.rs:512:13
   2: core::ops::function::FnOnce::call_once
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/core/src/ops/function.rs:250:5
   3: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/sys_common/backtrace.rs:155:18
   4: std::rt::lang_start::{{closure}}
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/rt.rs:166:18
   5: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/core/src/ops/function.rs:284:13
      std::panicking::try::do_call
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panicking.rs:554:40
      std::panicking::try
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panicking.rs:518:19
      std::panic::catch_unwind
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panic.rs:142:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/rt.rs:148:48
      std::panicking::try::do_call
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panicking.rs:554:40
      std::panicking::try
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panicking.rs:518:19
      std::panic::catch_unwind
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panic.rs:142:14
      std::rt::lang_start_internal
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/rt.rs:148:20
   6: std::rt::lang_start
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/rt.rs:165:17
   7: main
   8: __libc_start_call_main
             at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
   9: __libc_start_main_impl
             at ./csu/../csu/libc-start.c:360:3
  10: _start

The offending code in main:512 is dataset.get("samples_jfk.wav")?. So, this file already exists? I don't know where it is trying to be downloaded to, but I cannot find it anywhere on my home drive, so I don't think that is accurate.

LaurentMazare commented 2 days ago

It's likely trying to put it somewhere in .cache/huggingface/hub, maybe there is indeed already a file there but with a different owner or permissions that don't allow for overwriting the file? (looks more like an issue with hf_hub https://github.com/huggingface/hf-hub than with candle itself if that's not the case)