jianfch / stable-ts

Transcription, forced alignment, and audio indexing with OpenAI's Whisper
MIT License
1.59k stars 176 forks source link

Expose detect_language() from faster_whisper in load_faster_whisper object #235

Closed sthita-pujari closed 1 year ago

sthita-pujari commented 1 year ago

model = stable_whisper.load_faster_whisper('large-v2',download_root='./model/') In a separate code when I do this: model.detect_language(segment)[1] I get this when I want to use the detect_language standalone when loading faster_whisper. AttributeError: 'WhisperModel' object has no attribute 'detect_language'

Faster Whisper does support detect language https://github.com/guillaumekln/faster-whisper/blob/5a0541ea7d054aa3716ac492491de30158c20057/faster_whisper/transcribe.py#L311C27-L311C72 I was able to find the reference but not the code. Need help with this. Thank you in advanced.

jianfch commented 1 year ago

The method is in self.model in the reference, so it should be model.model.detect_language().

sthita-pujari commented 1 year ago

Thanks for the quick resolution.