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

ValueError with Transformers 4.41.x #129

Open
diegocr opened this issue May 26, 2024 · 0 comments
Open

ValueError with Transformers 4.41.x #129

diegocr opened this issue May 26, 2024 · 0 comments

Comments

@diegocr
Copy link

diegocr commented May 26, 2024

max_length=self._max_prompt_length,

(...)
      File "~\site-packages\dynamicprompts\generators\magicprompt.py", line 215, in _generate_magic_prompts
        prompts = self._generator(
      File "~\site-packages\transformers\pipelines\text_generation.py", line 263, in __call__
        return super().__call__(text_inputs, **kwargs)
      File "~\site-packages\transformers\pipelines\base.py", line 1224, in __call__
        outputs = list(final_iterator)
      File "~\site-packages\transformers\pipelines\pt_utils.py", line 124, in __next__
        item = next(self.iterator)
      File "~\site-packages\transformers\pipelines\pt_utils.py", line 125, in __next__
        processed = self.infer(item, **self.params)
      File "~\site-packages\transformers\pipelines\base.py", line 1150, in forward
        model_outputs = self._forward(model_inputs, **forward_params)
      File "~\site-packages\transformers\pipelines\text_generation.py", line 350, in _forward
        generated_sequence = self.model.generate(input_ids=input_ids, attention_mask=attention_mask, **generate_kwargs)
      File "~\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "~\site-packages\transformers\generation\utils.py", line 1648, in generate
        self._validate_generated_length(generation_config, input_ids_length, has_default_max_length)
      File "~\site-packages\transformers\generation\utils.py", line 1176, in _validate_generated_length
        raise ValueError(
    ValueError: Input length of input_ids is 70, but `max_length` is set to 70. This can lead to unexpected behavior. You should consider increasing `max_length` or, better yet, setting `max_new_tokens`.
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