-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Feature Update [added initial_prompt
support for automatic-speech-recognition whisper pipeline]
#28556
base: main
Are you sure you want to change the base?
Conversation
removed spaces from blank line
unformatted import fixed at line 14
unformatted import fixed at line no. 14
initial_prompt
for automatic-speech-recognition whisper pipeline]initial_prompt
support for automatic-speech-recognition whisper pipeline]
Hi thank you your code saved my day! I think line 535 needs to modify a bit |
@kaminwong , this is just to modify the output sequence to avoid showing Actual generation has device handles in below line. tokens = self.model.generate(
attention_mask=attention_mask,
**generate_kwargs,
) Apart from this token decoding part is serialised implementation which has no effect, that can be misuse of GPU. |
Thanks for the reply! But if I don't make that changes I get the following error, so I assume
I followed the code you posted:
|
@kaminwong , Thank you for addressing. I understood the issue. let me verify and reolved it. |
…/transformers/pipelines/automatic_speech_recognition.py
…/transformers/pipelines/automatic_speech_recognition.py (formatted)
@kaminwong , you can pull latest commit and install it should work now. its fixed. |
@Biswajit2902 any new updates? let me know if you need help |
@thomasmol I will update on this soon. was busy since two weeks. Thank you for the reminder. |
@thomasmol @sanchit-gandhi , i see below conflict in
I want to understand why we removed My changes before were working fine. But after this, there seems have some bug. I am working on resolving it. So need your input on this. |
Hey @Biswajit2902 - you can read the motivation for this change here. Essentially, we're unifying the preprocess_params["initial_prompt"] = initial_prompt And then convert the text prompt to token ids in the |
@sanchit-gandhi , Thanks for the pointer. Sorry got super busy could go back review. Will do it soon and close it. |
Latest 2605
remove unused.
Latest 2605
@sanchit-gandhi , Just an update. I have made the changes for this issue as suggested. But i have identified the output is not proper like before. seems like generate has some issue. its adding initial prompt with all the chunks. Will check and update on this. Also let me know if any existing issue going on this to your knowledge. |
cc @kamilakesbi as @sanchit-gandhi is off |
are there any updates on this? or other ways you know of for pushing the model to more easily detect certain words using this pipeline? |
Hey @basicblueberrry136, thanks for your comment! |
I believe this is very helpful when used with the serverless inference API. It seems that the serverless inference API uses the Transformers library to run models, and we cannot pass any parameter that has a type of tensor, as shown below: const data = fs.readFileSync(filename);
const b64 = data.toString('base64');
const body = JSON.stringify({
inputs: b64,
parameters: {
return_timestamps: true,
generate_kwargs: {
num_beams: 1,
prompt_ids: [50362, 27338, 3763, 48022, 2257, 48022, 6784, 118, 25157, 1546, 15789, 23987, 5975, 17174, 28472, 25750, 6062, 1543],
}
}
}); It results in the following error: {
"error": "unknown error",
"warnings": [
"There was an inference error: unknown error: list indices must be integers or slices, not NoneType"
]
} If |
Hi, thanks for your work! Are there any updates on this? |
What does this PR do?
Fixes # (feature)
initial_prompt
support for whisper Pipeline (automatic-speech-recognition)Before submitting
processor
considered as optional parameterWho can review?
Anyone in the community is free to review the PR once the tests have passed. @sanchit-gandhi , @Narsil, Can anyone help to take this PR forward please. Let me know, if anything is needed.
fixes #27317