Skip to content

Commit

Permalink
complete only one line
Browse files Browse the repository at this point in the history
  • Loading branch information
okdshin committed Nov 23, 2023
1 parent d700cd4 commit 2c5204b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flatline_lsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def generate_completion(self, text: str) -> str:
tokenized_prompt = self.tokenizer(text).input_ids
generated_tokens = self.model.generate(inputs=torch.LongTensor(
[tokenized_prompt]), max_new_tokens=self.max_new_tokens, do_sample=False,
#stopping_criteria=[stop_cutoff_completion, self.stop_word])[0]
stopping_criteria=[stop_cutoff_completion])[0]
stopping_criteria=[stop_cutoff_completion, self.stop_word])[0]
# stopping_criteria=[stop_cutoff_completion])[0]
generated_text = self.tokenizer.decode(generated_tokens[len(tokenized_prompt):])
return generated_text

Expand Down

0 comments on commit 2c5204b

Please sign in to comment.