argmaxinc / WhisperKit

On-device Speech Recognition for Apple Silicon
https://takeargmax.com/blog/whisperkit
MIT License
3.17k stars 267 forks source link

Added `@_disfavoredOverload` for deprecated methods #143

Closed jkrukowski closed 4 months ago

jkrukowski commented 4 months ago

Right now WhisperKit contains methods with the same arguments but different return type, e.g.

func transcribe(audioPath:decodeOptions:callback:) async throws -> TranscriptionResult?

and

func transcribe(audioPath:decodeOptions:callback:) async throws -> [TranscriptionResult]

This results in the issue described here https://github.com/argmaxinc/WhisperKit/issues/142 where compiler gives an error Ambiguous use of 'transcribe(audioPath:decodeOptions:callback:)

This PR resolves that by adding @_disfavoredOverload to deprecated methods