Skip to content

Commit

Permalink
[refactor] Tweak name (not override)
Browse files Browse the repository at this point in the history
  • Loading branch information
ftnext committed Dec 30, 2024
1 parent e61f29e commit 48e3ed9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions speech_recognition/recognizers/whisper_api/groq.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ def recognize(
"missing groq module: ensure that groq is set up correctly."
)

recognizer = OpenAICompatibleRecognizer(groq.Groq())
return recognizer.recognize(audio_data, model, **kwargs)
groq_recognizer = OpenAICompatibleRecognizer(groq.Groq())
return groq_recognizer.recognize(audio_data, model, **kwargs)
4 changes: 2 additions & 2 deletions speech_recognition/recognizers/whisper_api/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ def recognize(
"missing openai module: ensure that openai is set up correctly."
)

recognizer = OpenAICompatibleRecognizer(openai.OpenAI())
return recognizer.recognize(audio_data, model, **kwargs)
openai_recognizer = OpenAICompatibleRecognizer(openai.OpenAI())
return openai_recognizer.recognize(audio_data, model, **kwargs)
6 changes: 3 additions & 3 deletions speech_recognition/recognizers/whisper_local/whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TranscribeOutput(TypedDict):


def recognize(
self,
recognizer,
audio_data: AudioData,
model: str = "base",
show_dict: bool = False,
Expand All @@ -80,7 +80,7 @@ def recognize(
import whisper

whisper_model = whisper.load_model(model, **load_options or {})
recognizer = WhisperCompatibleRecognizer(whisper_model)
return recognizer.recognize(
whisper_recognizer = WhisperCompatibleRecognizer(whisper_model)
return whisper_recognizer.recognize(
audio_data, show_dict=show_dict, **transcribe_options
)

0 comments on commit 48e3ed9

Please sign in to comment.