Skip to content

docs: clarify --ref_audio needs an absolute path#1304

Open
moduvoice wants to merge 1 commit into
SWivid:mainfrom
moduvoice:docs/ref-audio-absolute-path
Open

docs: clarify --ref_audio needs an absolute path#1304
moduvoice wants to merge 1 commit into
SWivid:mainfrom
moduvoice:docs/ref-audio-absolute-path

Conversation

@moduvoice

Copy link
Copy Markdown

Problem

Following the README's CLI example verbatim, but passing a relative path for --ref_audio (the same convention the repo's own bundled infer/examples/basic/basic.toml uses: ref_audio = "infer/examples/basic/basic_ref_en.wav"), fails:

FileNotFoundError: [Errno 2] No such file or directory: '.../site-packages/f5_tts/venv/lib/python3.10/site-packages/f5_tts/infer/examples/basic/basic_ref_en.wav'

The path gets doubled — preprocess_ref_audio_text() resolves the given path relative to the installed f5_tts package directory, not the caller's working directory. An absolute path works immediately with no other change:

f5-tts_infer-cli --model F5TTS_v1_Base \
  --ref_audio "/absolute/path/to/basic_ref_en.wav" \
  --ref_text "Some call me nature, others call me mother nature." \
  --gen_text "I do not really care what you call me. I have been a silent spectator, watching species evolve, empires rise and fall."

Fix

  • README — one line noting that --ref_audio (and other file-path CLI args) should be given as an absolute path, since relative paths resolve against the installed package directory rather than the current working directory.

No code/behavior change — this is a documentation-only clarification.

Verification (Tesla T4 16GB)

Reproduced twice with the fix (absolute path) applied, using the maintainer's own bundled example (infer/examples/basic/basic.toml values):

Metric Run 1 Run 2
Generation time 4.43s 4.50s
Wall time (incl. model+vocoder load) 16.26s 16.32s
Output duration 11.24s 11.24s (deterministic)

Peak VRAM: 1.625 GB (comfortably fits Tesla T4's 16GB, ~90% headroom).

Environment: Tesla T4 16GB · driver 550.163.01 (CUDA 12.4) · Python 3.10.12 · torch 2.8.0+cu128 (the README-pinned cu128 wheel works fine on this driver — no CUDA-version mismatch here).

Also confirmed the model's own dtype auto-selection (load_checkpoint() picking torch.float16 when torch.cuda.get_device_properties(device).major >= 7) already does the right thing on Turing/T4 — no change needed there, this PR is scoped to the path-resolution documentation gap only.

Raw metrics JSON
{
  "run1": {"gen_time_s": 4.43, "wall_time_s": 16.263, "output_duration_s": 11.24, "sample_rate": 24000},
  "run2": {"gen_time_s": 4.50, "wall_time_s": 16.316, "output_duration_s": 11.24, "sample_rate": 24000},
  "peak_vram_mib": 1625,
  "gpu": "Tesla T4", "driver": "550.163.01", "torch": "2.8.0+cu128"
}

Relative paths are resolved against the installed f5_tts package
directory, not the caller's cwd, causing a confusing doubled-path
FileNotFoundError. No code/behavior change.

Verified on Tesla T4 16GB (driver 550.163.01, torch 2.8.0+cu128):
absolute path works immediately, reproduced 2x.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant