Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into #109
Browse files Browse the repository at this point in the history
  • Loading branch information
0dm committed May 10, 2023
2 parents 0e4e0ca + 0ab8213 commit 796e35a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openadapt/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def diff(self):
@property
def diff_mask(self):
if not self._diff_mask:
self._diff_mask = self._diff.convert("1")
self._diff_mask = self.diff.convert("1")
return self._diff_mask

@property
Expand Down
6 changes: 5 additions & 1 deletion openadapt/strategies/llm_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def get_completion(
logger.warning(
f"Truncating from {len(prompt)=} to {max_input_size=}"
)
prompt = prompt[max_input_size:]
prompt = prompt[-max_input_size:]
logger.warning(
f"Truncated {len(prompt)=}"
)

logger.debug(f"{prompt=} {max_tokens=}")
input_tokens = self.tokenizer(prompt, return_tensors="pt")
pad_token_id = self.tokenizer.eos_token_id
Expand Down

0 comments on commit 796e35a

Please sign in to comment.