Move torchcodec to optional dependencies #1244
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Moves
torchcodecfrom required dependencies to optional dependencies to improve installation reliability and reduce unnecessary requirements for core TTS functionality.Problem
Currently,
torchcodecis listed as a required dependency, but:AttributeError: module 'torchcodec' has no attribute 'decoders'due to incomplete or broken installations, particularly on macOS Intel machinesUse Case Analysis
torchcodecis primarily useful for:For standard text-to-speech workflows (which represent the majority of F5-TTS use cases), torchcodec is never utilized.
Solution
Move
torchcodecto optional dependencies under a newvideoextra (or include infullextra if preferred).Changes
Users who need video processing capabilities can install with:
Benefits
Testing
[video]extraMigration Path
Users currently relying on torchcodec (if any) can simply install with:
Or add it manually:
Alternative Consideration
If the maintainers prefer,
torchcodeccould be added to an existingfullextra instead of creating a newvideoextra.