mirror of
https://github.com/SillyTavern/SillyTavern-Extras.git
synced 2026-04-20 22:48:57 +00:00
Add whisper to feature complete requirements
This commit is contained in:
@@ -9,6 +9,8 @@ torchvision >= 0.9, < 0.13
|
||||
torchaudio >= 0.9, < 0.13
|
||||
numpy
|
||||
accelerate
|
||||
SpeechRecognition~=3.9.0
|
||||
git+https://github.com/huggingface/transformers
|
||||
git+https://github.com/huggingface/diffusers
|
||||
git+https://github.com/coqui-ai/TTS
|
||||
git+https://github.com/openai/whisper
|
||||
18
stt.py
Normal file
18
stt.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import speech_recognition as sr
|
||||
import whisper
|
||||
|
||||
english = True
|
||||
|
||||
|
||||
def init_stt(model="base", english=True, energy=300, pause=0.8, dynamic_energy=False):
|
||||
if model != "large" and english:
|
||||
model = model + ".en"
|
||||
audio_model = whisper.load_model(model)
|
||||
r = sr.Recognizer()
|
||||
r.energy_threshold = energy
|
||||
r.pause_threshold = pause
|
||||
r.dynamic_energy_threshold = dynamic_energy
|
||||
return r, audio_model
|
||||
|
||||
|
||||
r, audio_model = init_stt()
|
||||
Reference in New Issue
Block a user