Spaces:
Running on Zero
Running on Zero
Vansh Chugh commited on
Commit ·
c5b3e92
1
Parent(s): e06e0e7
fix: direct LightningMusicgen instantiation, not params.instantiate()
Browse files
app.py
CHANGED
|
@@ -75,7 +75,8 @@ def build_params(encodec_weights: str, lm_weights: str) -> hp.MusicgenParams:
|
|
| 75 |
|
| 76 |
def load_checkpoint(params: hp.MusicgenParams, ckp_path: str) -> LightningMusicgen:
|
| 77 |
"""Instantiate model from params and load fine-tuned checkpoint onto CPU."""
|
| 78 |
-
model
|
|
|
|
| 79 |
sft.load_model(model, ckp_path)
|
| 80 |
return model.cpu().eval()
|
| 81 |
|
|
|
|
| 75 |
|
| 76 |
def load_checkpoint(params: hp.MusicgenParams, ckp_path: str) -> LightningMusicgen:
|
| 77 |
"""Instantiate model from params and load fine-tuned checkpoint onto CPU."""
|
| 78 |
+
model = LightningMusicgen(params) # direct instantiation bcs params.instantiate() uses
|
| 79 |
+
# pydoc.locate("stage.*") which fails after flattening
|
| 80 |
sft.load_model(model, ckp_path)
|
| 81 |
return model.cpu().eval()
|
| 82 |
|