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

Fixed bug with encoder only models not expecting "labels" argument in forward pass #264

Merged
merged 3 commits into from
Jun 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed type annotations
  • Loading branch information
AugustasMacijauskas committed Jun 27, 2023
commit 75b80ca9a26cc3f0d4856df2ace50661b78445ca
2 changes: 1 addition & 1 deletion elk/extraction/extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def extract_hiddens(
# Record the EXACT question we fed to the model
variant_questions.append(text)

inputs = dict(input_ids=ids.long())
inputs: dict[str, Tensor | None] = dict(input_ids=ids.long())
if is_enc_dec:
inputs["labels"] = labels
outputs = model(**inputs, output_hidden_states=True)
Expand Down
Loading