Skip to content

fix(transcribe): accept a Hugging Face model id in EASYEDIT_WHISPER - #77

Merged
blixvip merged 1 commit into
blixvip:mainfrom
hskl18:fix/71-cache-name-model-id
Nov 16, 2026
Merged

blixvip merged 1 commit into
blixvip:mainfrom
hskl18:fix/71-cache-name-model-id

Conversation

@hskl18

@hskl18 hskl18 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

What does this change?

Fixes #71. cache_for() put the raw EASYEDIT_WHISPER value into the transcript cache file name, so a Hugging Face id such as Systran/faster-whisper-small raised ValueError: Invalid name 'words-abc-en-Systran/faster-whisper-small.json' before transcription started.

The model part of the name now has every character outside [A-Za-z0-9._-] replaced with _, as the issue suggests, giving words-abc-en-Systran_faster-whisper-small.json. Plain names such as distil-large-v3 keep their current cache name, and transcribe() still passes the raw value to faster-whisper.

A value that already worked but holds other characters (a Windows path on macOS or Linux, a name with a space) gets a new cache name, so that job transcribes once more and picks its quote again, replacing quote.json.

How did you test it?

  • python -m unittest discover passes: 87 tests on macOS, Python 3.12.16 (86 on main).
  • python -m easyedit.doctor reports ready (CPU only).
  • Made a real edit end to end: not run; only the cache file name changes, and I downloaded no model.
  • UI changes checked in a real browser: no UI change.

The new test in tests/test_transcribe_cache.py checks that Systran/faster-whisper-small, C:\models\small and /models/small stay in the cache folder with a file-safe name, and that distil-large-v3 keeps its name. On main it errors with the same Invalid name error. I also called cache_for() with each value before and after the change. On macOS I checked the Windows path with PureWindowsPath, which rejects the name main builds for it with the same ValueError; I did not run it on Windows.

Checklist

  • One fix or feature, kept small and focused
  • Used the easyedit/util.py helpers: not applicable, no subprocess calls
  • No new runtime dependency
  • Nothing committed from jobs/, .cache/, node_modules/, or any footage
  • README updated: not changed; it already calls EASYEDIT_WHISPER a faster-whisper model name, which covers Hugging Face ids and folders

OS tested: macOS.

@blixvip
blixvip merged commit e77dec3 into blixvip:main Nov 16, 2026
2 checks passed
@blixvip

blixvip commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Thanks @hskl18, this is merged! Hugging Face model ids and folder paths in EASYEDIT_WHISPER now work, so the transcript cache no longer crashes before transcription starts.

Next step if you want another one: good first issue #73, "Tell screen readers whether the Options panel is open" (#73).

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.

Accept a Hugging Face model id in EASYEDIT_WHISPER

2 participants