Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 6, 2023
1 parent 3a055e3 commit a8f2d40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cht-petals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def safe_decode(
fake_token = tokenizer("^")["input_ids"][0]
outputs = outputs.tolist() if isinstance(outputs, torch.Tensor) else outputs
result = tokenizer.decode([fake_token] + outputs).replace("<s>", "")

for stop_token in stop_tokens:
result = result.split(stop_token)[0]
return result

0 comments on commit a8f2d40

Please sign in to comment.