Skip to content

TypeError: forward() got an unexpected keyword argument 'last_token_only' #25

@MobiusRanx

Description

@MobiusRanx

Traceback (most recent call last):
File "/home/boofboy/Desktop/x/main.py", line 124, in
output_ids = model.generate(input_ids=input_ids, max_length=max_length,
File "/home/boofboy/miniconda3/envs/mini/lib/python3.9/site-packages/flash_attn-1.0.4-py3.9-linux-x86_64.egg/flash_attn/utils/generation.py", line 167, in generate
output = decode(input_ids, self, max_length, top_k=top_k, top_p=top_p,
File "/home/boofboy/miniconda3/envs/mini/lib/python3.9/site-packages/flash_attn-1.0.4-py3.9-linux-x86_64.egg/flash_attn/utils/generation.py", line 115, in decode
logits = model(input_ids, inference_params=inference_params, last_token_only=True).logits
File "/home/boofboy/miniconda3/envs/mini/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
TypeError: forward() got an unexpected keyword argument 'last_token_only'

when adding the last_token_only option, it naturally gives the error during torch.multinomial(torch.softmax(logits_top, dim=-1), num_samples=1).squeeze(dim=-1)
RuntimeError: prob_dist must be 1 or 2 dim.

im using pytorch 2.0. all libraries have been installed.
Any help would be much appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions