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 with running huggingface example code #81

Open
alexmil2019 opened this issue Jan 10, 2025 · 2 comments
Open

error with running huggingface example code #81

alexmil2019 opened this issue Jan 10, 2025 · 2 comments

Comments

@alexmil2019
Copy link

alexmil2019 commented Jan 10, 2025

I get this error when running the huggingface example code: torch.version: '2.5.1+cu124'

File ~/.conda/envs/torch_p10/lib/python3.10/site-packages/transformers/models/moonshine/modeling_moonshine.py:827, in MoonshineDecoder.forward(self, input_ids, attention_mask, position_ids, past_key_values, inputs_embeds, use_cache, output_attentions, output_hidden_states, return_dict, cache_position, encoder_hidden_states, **flash_attn_kwargs)
    824 return_dict = return_dict if return_dict is not None else self.config.use_return_dict
    826 if (input_ids is None) ^ (inputs_embeds is not None):
--> 827     raise ValueError("You must specify exactly one of input_ids or inputs_embeds")
    829 if self.gradient_checkpointing and self.training and use_cache:
    830     logger.warning_once(
    831         "`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`."
    832     )

ValueError: You must specify exactly one of input_ids or inputs_embeds

here is the code I ran:

audio, sr = torchaudio.load('audio.wav')
start_sample = int(29.920*sr)
end_sample = int(33.440*sr)
segment = audio[:,start_sample:end_sample].to('cuda')
tokens = model(segment)

In [40]: segment.shape
Out[40]: torch.Size([1, 56320])

@alexmil2019
Copy link
Author

it seems the readme file needs to be merged to show the new updates on huggingface usecase.
c80e3e7

@alexmil2019
Copy link
Author

alexmil2019 commented Jan 10, 2025

I get this warning with the new hggingface code: "Setting pad_token_id to eos_token_id:2 for open-end generation."
These values need to be set: max_new_tokens=100, pad_token_id=2

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