Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a base_url parameter to the recognize_whisper_api function. #794

Closed
amosdevstudio opened this issue Nov 24, 2024 · 6 comments · Fixed by #797
Closed

Adding a base_url parameter to the recognize_whisper_api function. #794

amosdevstudio opened this issue Nov 24, 2024 · 6 comments · Fixed by #797
Assignees

Comments

@amosdevstudio
Copy link

Just that. I would like to use the Groq API (https://groq.com/), but to do that I had to change the library's code. It's a simple fix, actually.

@ftnext
Copy link
Collaborator

ftnext commented Nov 24, 2024

Groq provides whisper models. I see...
https://console.groq.com/docs/speech-text

@amosdevstudio
Copy link
Author

Yes, exactly. That's why i need the base_url parameter. To use groq i need to put their url there and their api key.

@amosdevstudio
Copy link
Author

amosdevstudio commented Nov 28, 2024

Hey, could you merge the PR #795 ?

@ftnext
Copy link
Collaborator

ftnext commented Dec 3, 2024

Thanks the PR, but I want to use groq library.
Draft: a099938

In Groq documentation, groq library is used.
From my viewpoint, openai library with base_url seems kind of hack for workaround.

@ftnext ftnext self-assigned this Dec 4, 2024
@ftnext
Copy link
Collaborator

ftnext commented Dec 8, 2024

@amosdevstudio Try SpeechRecognition 3.12.0, which supports Groq.

python -m pip install SpeechRecognition==3.12.0

>>> # NOTICE: export GROQ_API_KEY before launching Python interpreter
>>> import speech_recognition as sr
>>> r = sr.Recognizer()
>>> with sr.AudioFile("english.wav") as source:
...   audio = r.record(source)
>>>
>>> r.recognize_groq(audio)
' One, two, three.'

@amosdevstudio
Copy link
Author

Great! I love to see this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants