Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Remove nbsp
Browse files- code_samples/accelerate +1 -1
code_samples/accelerate
CHANGED
@@ -7,7 +7,7 @@ train_dataloader, model, optimizer scheduler = accelerator.prepare(
|
|
7 |
|
8 |
model.train()
|
9 |
for batch in train_dataloader:
|
10 |
-
|
11 |
inputs, targets = batch
|
12 |
outputs = model(inputs)
|
13 |
loss = loss_function(outputs, targets)
|
|
|
7 |
|
8 |
model.train()
|
9 |
for batch in train_dataloader:
|
10 |
+
optimizer.zero_grad()
|
11 |
inputs, targets = batch
|
12 |
outputs = model(inputs)
|
13 |
loss = loss_function(outputs, targets)
|