Specify language for transcribing with HuggingFace API
Hi!
I'm using this model with my python script as an online inference (sending post requests).
Is there a way to specify the language of the audio I have sent?
As it is written in the model card, you can use this, where you can specify your language and the task: transcribe or translate.result = pipe(sample, return_timestamps=True, generate_kwargs={"language": "french", "task": "translate"})
print(result["chunks"])
As it is written in the model card, you can use this, where you can specify your language and the task: transcribe or translate.
result = pipe(sample, return_timestamps=True, generate_kwargs={"language": "french", "task": "translate"})
print(result["chunks"])
Thank you for the answer!
In my code the usage is like so:
response = requests.post("https://api-inference.huggingface.co/models/openai/whisper-large-v3", headers=headers, data=data)
where in the headers I put my api_token, and the data is:
with open(mp3_path, 'rb') as f:
data = f.read()
Can your suggestion be used in my code, or should I adapt it to be able to use it?
Thanks again!
Oh, you use the API. I can't help you with that kind of thing. I thought you were hosting your own model. Maybe you should specify that you are using the HF API in the title for more help with someone who know more about HF API.
Oh, you use the API. I can't help you with that kind of thing. I thought you were hosting your own model. Maybe you should specify that you are using the HF API in the title for more help with someone who know more about HF API.
Yep, probably should have thought about it haha.
Thanks for answering though!
Do you have the answer yet?
can you help me, i want to add specify language too :<
can you help me, i want to add specify language too :<
I didn't find an answer yet.
It seems like you can't specify the language that way.