Skip to content

Commit

Permalink
try no grad
Browse files Browse the repository at this point in the history
  • Loading branch information
thejaminator committed May 6, 2023
1 parent 59bbdb8 commit 3d53555
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elk/extraction/extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ def extract_hiddens(
# If we cached the question, all we need to pass is the answer
inputs["past_key_values"] = cached_question_kv

Check failure on line 311 in elk/extraction/extraction.py

View workflow job for this annotation

GitHub Actions / run-tests (3.11, ubuntu-latest)

Argument of type "tuple[tuple[Tensor]]" cannot be assigned to parameter "__value" of type "Tensor" in function "__setitem__"   "tuple[tuple[Tensor]]" is incompatible with "Tensor" (reportGeneralTypeIssues)
inputs["input_ids"] = answer

outputs = model(**inputs, output_hidden_states=True, use_cache=True)
with torch.no_grad():
outputs = model(**inputs, output_hidden_states=True, use_cache=True)

cached_question_kv = (
get_reusable_kv(
Expand Down

0 comments on commit 3d53555

Please sign in to comment.