Spaces:
Runtime error
Runtime error
improve piepline loading
Browse files
audiodiffusion/__init__.py
CHANGED
@@ -43,11 +43,13 @@ class AudioDiffusion:
|
|
43 |
hop_length=hop_length,
|
44 |
top_db=top_db)
|
45 |
self.model_id = model_id
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
51 |
if cuda:
|
52 |
self.pipe.to("cuda")
|
53 |
self.progress_bar = progress_bar or (lambda _: _)
|
|
|
43 |
hop_length=hop_length,
|
44 |
top_db=top_db)
|
45 |
self.model_id = model_id
|
46 |
+
pipeline = {
|
47 |
+
'LatentAudioDiffusionPipeline': LatentAudioDiffusionPipeline,
|
48 |
+
'AudioDiffusionPipeline': AudioDiffusionPipeline
|
49 |
+
}.get(
|
50 |
+
DiffusionPipeline.get_config_dict(self.model_id)['_class_name'],
|
51 |
+
AudioDiffusionPipeline)
|
52 |
+
self.pipe = pipeline.from_pretrained(self.model_id)
|
53 |
if cuda:
|
54 |
self.pipe.to("cuda")
|
55 |
self.progress_bar = progress_bar or (lambda _: _)
|