Spaces:
Runtime error
Runtime error
Load schedulers using .from_config
Browse files
model.py
CHANGED
|
@@ -51,15 +51,13 @@ class Model:
|
|
| 51 |
elif scheduler_type == 'DDIM':
|
| 52 |
pipeline = DDIMPipeline.from_pretrained(repo_id,
|
| 53 |
use_auth_token=HF_TOKEN)
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
pipeline.scheduler = DDIMScheduler(**config)
|
| 57 |
elif scheduler_type == 'PNDM':
|
| 58 |
pipeline = PNDMPipeline.from_pretrained(repo_id,
|
| 59 |
use_auth_token=HF_TOKEN)
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
pipeline.scheduler = PNDMScheduler(**config)
|
| 63 |
else:
|
| 64 |
raise ValueError
|
| 65 |
return pipeline
|
|
|
|
| 51 |
elif scheduler_type == 'DDIM':
|
| 52 |
pipeline = DDIMPipeline.from_pretrained(repo_id,
|
| 53 |
use_auth_token=HF_TOKEN)
|
| 54 |
+
pipeline.scheduler = DDIMScheduler.from_config(
|
| 55 |
+
repo_id, subfolder='scheduler', use_auth_token=HF_TOKEN)
|
|
|
|
| 56 |
elif scheduler_type == 'PNDM':
|
| 57 |
pipeline = PNDMPipeline.from_pretrained(repo_id,
|
| 58 |
use_auth_token=HF_TOKEN)
|
| 59 |
+
pipeline.scheduler = PNDMScheduler.from_config(
|
| 60 |
+
repo_id, subfolder='scheduler', use_auth_token=HF_TOKEN)
|
|
|
|
| 61 |
else:
|
| 62 |
raise ValueError
|
| 63 |
return pipeline
|