-
Notifications
You must be signed in to change notification settings - Fork 488
[Inference] Add ASR support for Replicate provider #1679
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lucataco, thanks a lot for the contribution! could you also add the automatic-speech-recognition
mapping for Replicate in
export const PROVIDERS: Record<InferenceProvider, Partial<Record<InferenceTask, TaskProviderHelper>>> = { |
you can find the complete guideline for provider/task JS integration in the documentation here: https://huggingface.co/docs/inference-providers/register-as-a-provider#2-js-client-integration
Thank you for taking a look! Ive added the mapping as specified |
const out = response?.output as | ||
| undefined | ||
| { | ||
transcription?: string; | ||
translation?: string; | ||
txt_file?: string; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following the schema defined in https://replicate.com/openai/whisper/api/schema#output-schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lucataco for the PR! I pushed a commit to fix the response parsing part.
Also, i think the version is missing in the providerId
defined in the Replicate model mapping: https://huggingface.co/api/partners/replicate/models. it should be
"openai/whisper:8099696689d249cf8b122d833c36ac3f75505c666a395ca40ef26f68e7d3d16e"
. could you update it accordingly? thanks 🙏
Oh good catch, thank you! Yes of course. |
Hello! This PR adds support for the
Automatic Speech Recognition
task type for Replicate models.Example:
cc @hanouticelina