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

Error while running cli_inference.py #93

Open
Dipto084 opened this issue Jan 10, 2025 · 0 comments
Open

Error while running cli_inference.py #93

Dipto084 opened this issue Jan 10, 2025 · 0 comments

Comments

@Dipto084
Copy link

I am trying to run the inference code on a audio file with a text prompt, after I provide the wav_path and the prompt, I get this error -

spectrogram = wav_processor(audio, sampling_rate=sr, return_tensors="pt")["input_features"]
File "../SALMONN/salmonn_env/lib/python3.10/site-packages/transformers/models/whisper/feature_extraction_whisper.py", line 364, in call
padded_inputs = padded_inputs.convert_to_tensors(return_tensors)
File "../SALMONN/salmonn_env/lib/python3.10/site-packages/transformers/feature_extraction_utils.py", line 171, in convert_to_tensors
raise ValueError(
ValueError: Unable to create tensor, you should probably activate padding with 'padding=True' to have batched tensors with the same length.

I tried adding padding=True in the `spectrogram = wav_processor(audio, sampling_rate=sr, return_tensors="pt")["input_features"]' line, but does not help either, shows the same error

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

No branches or pull requests

1 participant