mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 17:29:22 +01:00
tweaked Whisper parameters
This commit is contained in:
parent
d5efc0659b
commit
a24fa781f1
@ -11,11 +11,11 @@ def do_stt():
|
|||||||
transcription = ""
|
transcription = ""
|
||||||
r = sr.Recognizer()
|
r = sr.Recognizer()
|
||||||
with sr.Microphone() as source:
|
with sr.Microphone() as source:
|
||||||
r.adjust_for_ambient_noise(source)
|
r.adjust_for_ambient_noise(source, 0.2)
|
||||||
audio = r.listen(source)
|
audio = r.listen(source)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
transcription = r.recognize_whisper(audio, language="english", model="tiny.en")
|
transcription = r.recognize_whisper(audio, language="english", model="base.en")
|
||||||
except sr.UnknownValueError:
|
except sr.UnknownValueError:
|
||||||
print("Whisper could not understand audio")
|
print("Whisper could not understand audio")
|
||||||
except sr.RequestError as e:
|
except sr.RequestError as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user