WhisperKit
WhisperKit copied to clipboard
Make public enums conform to Sendable
Concurrency and safety improvements:
- Added the
Sendableprotocol conformance to several enums (ModelVariant,ModelState,ChunkingStrategy,TranscriptionState, andWhisperError) to ensure they can be safely used across threads in concurrent code.
Code organization and utility refactoring:
- Refactored utility types (
ModelUtilities,TextUtilities, andTranscriptionUtilities) from structs with private initializers to enums with only static methods, and made them conform toSendable. This clarifies their intended usage as namespaces for static utilities and improves thread safety. - Removed unused or redundant instance-level methods from
ModelUtilitiesto streamline the utility interface.