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

05_seminar: error - unexpected keyword argument 'input_ids' #130

Open
chistotinsa opened this issue Oct 24, 2023 · 0 comments
Open

05_seminar: error - unexpected keyword argument 'input_ids' #130

chistotinsa opened this issue Oct 24, 2023 · 0 comments

Comments

@chistotinsa
Copy link

class MyBertBasedClassifier(nn.Module):
def init(self):
super().init()
self.bert = transformers.AutoModel.from_pretrained('bert-base-uncased')
self.head = nn.Linear(768, 2)

def forward(self, **kwargs):
  out = model(**tokens_info)['pooler_output']
  return self.head(out)

clf = MyBertBasedClassifier()
clf(**tokens_info)

'''the last string returns an error:
TypeError: _forward_unimplemented() got an unexpected keyword argument 'input_ids'

I double-checked an entire code and its equal to the code in the original seminar notebook. Cant understand whats wrong.'''

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