Skip to content

Commit 056cea8

Browse files
committed
Ran ruff to format the files
1 parent 98cc0f2 commit 056cea8

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

QEfficient/cloud/finetune.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def main(**kwargs):
6363
# TODO: may have to init qccl backend, next try run with torchrun command
6464
torch_device = torch.device(device)
6565
assert torch_device.type != "cpu", "Host doesn't support single-node DDP"
66-
assert (
67-
torch_device.index is None
68-
), f"DDP requires specification of device type only, however provided device index as well: {torch_device}"
66+
assert torch_device.index is None, (
67+
f"DDP requires specification of device type only, however provided device index as well: {torch_device}"
68+
)
6969
dist.init_process_group(backend=train_config.dist_backend)
7070
# from here onward "qaic/cuda" will automatically map to "qaic:i/cuda:i", where i = process rank
7171
getattr(torch, torch_device.type).set_device(dist.get_rank())
@@ -126,7 +126,6 @@ def main(**kwargs):
126126
model = get_peft_model(model, peft_config)
127127
model.print_trainable_parameters()
128128

129-
130129
# Get the dataset utils
131130
dataset_config = generate_dataset_config(train_config, kwargs)
132131
dataset_processer = tokenizer

QEfficient/finetune/utils/train_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ def train(
211211
train_step_loss.append(loss.detach().float().item())
212212
train_step_perplexity.append(float(torch.exp(loss.detach().float())))
213213

214-
215214
if train_config.grad_scaler:
216215
scaler.scale(loss).backward() # backward pass
217216
else:

0 commit comments

Comments
 (0)