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
Fixed a bug with decoder-only models
  • Loading branch information
AugustasMacijauskas committed Jun 27, 2023
commit ca463a2893900938fe44a42bcd22dbbc7056226b
2 changes: 1 addition & 1 deletion elk/extraction/extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def extract_hiddens(
variant_questions.append(text)

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

Expand Down