Spaces:
Running
Running
fix: Update accelerator logic in predict function
Browse files
app.py
CHANGED
@@ -63,7 +63,7 @@ def predict(
|
|
63 |
dataloader = DataLoader(tokenized_dataset, batch_size=batch_size, num_workers=num_workers, persistent_workers=True)
|
64 |
model = deepchopper.DeepChopper.from_pretrained("yangliz5/deepchopper")
|
65 |
|
66 |
-
accelerator = "
|
67 |
trainer = lightning.pytorch.trainer.Trainer(
|
68 |
accelerator=accelerator,
|
69 |
deterministic=False,
|
|
|
63 |
dataloader = DataLoader(tokenized_dataset, batch_size=batch_size, num_workers=num_workers, persistent_workers=True)
|
64 |
model = deepchopper.DeepChopper.from_pretrained("yangliz5/deepchopper")
|
65 |
|
66 |
+
accelerator = "gpu" if torch.cuda.is_available() else "cpu"
|
67 |
trainer = lightning.pytorch.trainer.Trainer(
|
68 |
accelerator=accelerator,
|
69 |
deterministic=False,
|