Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -18,12 +18,13 @@ bases = {
|
|
18 |
step_loaded = None
|
19 |
base_loaded = "ToonYou"
|
20 |
motion_loaded = None
|
21 |
-
|
22 |
# Ensure model and scheduler are initialized in GPU-enabled function
|
23 |
if not torch.cuda.is_available():
|
24 |
-
|
|
|
|
|
25 |
|
26 |
-
device = "cpu"
|
27 |
dtype = None
|
28 |
pipe = AnimateDiffPipeline.from_pretrained(bases[base_loaded], torch_dtype=dtype).to(device)
|
29 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
|
|
|
18 |
step_loaded = None
|
19 |
base_loaded = "ToonYou"
|
20 |
motion_loaded = None
|
21 |
+
device = "cuda"
|
22 |
# Ensure model and scheduler are initialized in GPU-enabled function
|
23 |
if not torch.cuda.is_available():
|
24 |
+
device = "cpu"
|
25 |
+
#raise NotImplementedError("No GPU detected!")
|
26 |
+
|
27 |
|
|
|
28 |
dtype = None
|
29 |
pipe = AnimateDiffPipeline.from_pretrained(bases[base_loaded], torch_dtype=dtype).to(device)
|
30 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing", beta_schedule="linear")
|