-
Notifications
You must be signed in to change notification settings - Fork 81
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
Running Unlimiformer with the forward
method
#38
Comments
Hi @testzer0 -- what is the specific error you're seeing here? Thanks! |
I also have issues with running ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
[<ipython-input-9-5679df71b070>](https://localhost:8080/#) in <cell line: 1>()
----> 1 out = model(**example)
2 out
2 frames
[/content/unlimiformer/src/unlimiformer.py](https://localhost:8080/#) in pre_forward_hook(self, input_ids, attention_mask, labels, **kwargs)
545 if input_ids is not None:
546 # self.input_ids_size += input_ids.shape[-1]
--> 547 self.input_ids_size += 1
548 if kwargs.get('decoder_input_ids') is not None:
549 self.generated_input_ids = torch.cat([self.generated_input_ids, kwargs['decoder_input_ids']], axis=-1)
AttributeError: 'UnlimiformerBART' object has no attribute 'input_ids_size' Here is my colab (based on inference-example.py) for more details and being able to reproduce error. Thank you! |
I've just pushed a fix for this issue-- please let me know if you're still having problems with the newest version! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I am currently trying to run the inference example with a slight modification. Instead of
generate()
-ing text, I want to pass ininput_ids
andlabels
to theforward
function and obtain the logits. However, the current implementation leads to device-side asserts. How may I achieve the above goal?The text was updated successfully, but these errors were encountered: