Skip to content

Commit 069ed7c

Browse files
committed
Lint
1 parent 193548e commit 069ed7c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

modules/llama_cpp_python_hijack.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,24 @@ def eval_with_progress(self, tokens: Sequence[int]):
3636
progress_bar = range(0, len(tokens), self.n_batch)
3737

3838
for i in progress_bar:
39-
batch = tokens[i : min(len(tokens), i + self.n_batch)]
39+
batch = tokens[i: min(len(tokens), i + self.n_batch)]
4040
n_past = self.n_tokens
4141
n_tokens = len(batch)
4242
self._batch.set_batch(
4343
batch=batch, n_past=n_past, logits_all=self.context_params.logits_all
4444
)
4545
self._ctx.decode(self._batch)
4646
# Save tokens
47-
self.input_ids[n_past : n_past + n_tokens] = batch
47+
self.input_ids[n_past: n_past + n_tokens] = batch
4848
# Save logits
4949
rows = n_tokens
5050
cols = self._n_vocab
5151
offset = (
5252
0 if self.context_params.logits_all else n_tokens - 1
5353
) # NOTE: Only save the last token logits if logits_all is False
54-
self.scores[n_past + offset : n_past + n_tokens, :].reshape(-1)[
54+
self.scores[n_past + offset: n_past + n_tokens, :].reshape(-1)[
5555
:
56-
] = self._ctx.get_logits()[offset * cols : rows * cols]
56+
] = self._ctx.get_logits()[offset * cols: rows * cols]
5757
# Update n_tokens
5858
self.n_tokens += n_tokens
5959

modules/presets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def random_preset(state):
125125
for cat in params_and_values:
126126
choices = list(params_and_values[cat].keys())
127127
if shared.args.loader is not None:
128-
choices = [x for x in choices if loader_contains(sampler)]
128+
choices = [x for x in choices if loader_contains(x)]
129129

130130
if len(choices) > 0:
131131
choice = random.choice(choices)

0 commit comments

Comments
 (0)