Commit ·
40c5502
1
Parent(s): e4c7828
Add known good MelodyFlow local setup
Browse files- README.md +42 -0
- docs/MELODYFLOW.md +12 -0
README.md
CHANGED
|
@@ -41,6 +41,48 @@ Where these findings are documented:
|
|
| 41 |
- operational notes and fork workflow: [docs/MELODYFLOW.md](./docs/MELODYFLOW.md)
|
| 42 |
- hub-facing model card notes: [model_cards/MELODYFLOW_MODEL_CARD.md](./model_cards/MELODYFLOW_MODEL_CARD.md)
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
## Installation
|
| 46 |
AudioCraft requires Python 3.9, PyTorch 2.1.0. To install AudioCraft, you can run the following:
|
|
|
|
| 41 |
- operational notes and fork workflow: [docs/MELODYFLOW.md](./docs/MELODYFLOW.md)
|
| 42 |
- hub-facing model card notes: [model_cards/MELODYFLOW_MODEL_CARD.md](./model_cards/MELODYFLOW_MODEL_CARD.md)
|
| 43 |
|
| 44 |
+
## Known Good Local Setup
|
| 45 |
+
|
| 46 |
+
This is the local setup that actually produced usable text-to-music output during recovery work:
|
| 47 |
+
|
| 48 |
+
- a Python environment dedicated to MelodyFlow inference
|
| 49 |
+
- the released checkpoint directory, for example `facebook/melodyflow-t24-30secs`
|
| 50 |
+
- the official MelodyFlow Space checkout or a maintained fork of that checkout
|
| 51 |
+
- code that imports `MelodyFlow` from that Space checkout and loads checkpoints with `weights_only=False` when required on PyTorch 2.6+
|
| 52 |
+
|
| 53 |
+
Operationally, the local flow looked like this:
|
| 54 |
+
|
| 55 |
+
1. Set a model directory pointing at the released checkpoint folder.
|
| 56 |
+
2. Set a code checkout pointing at the official Space or your maintained fork.
|
| 57 |
+
3. Import `from audiocraft.models import MelodyFlow` from that checkout.
|
| 58 |
+
4. Call `MelodyFlow.get_pretrained(...)` against the local checkpoint directory.
|
| 59 |
+
5. Generate audio only after the code path and checkpoint-loading path are confirmed correct.
|
| 60 |
+
|
| 61 |
+
Example pattern:
|
| 62 |
+
|
| 63 |
+
```python
|
| 64 |
+
import torch
|
| 65 |
+
from pathlib import Path
|
| 66 |
+
|
| 67 |
+
space_repo = Path("path/to/MelodyFlowSpace-or-your-fork")
|
| 68 |
+
model_dir = Path("path/to/melodyflow-t24-30secs")
|
| 69 |
+
|
| 70 |
+
original_load = torch.load
|
| 71 |
+
|
| 72 |
+
def trusted_load(*args, **kwargs):
|
| 73 |
+
kwargs.setdefault("weights_only", False)
|
| 74 |
+
return original_load(*args, **kwargs)
|
| 75 |
+
|
| 76 |
+
torch.load = trusted_load
|
| 77 |
+
try:
|
| 78 |
+
from audiocraft.models import MelodyFlow
|
| 79 |
+
model = MelodyFlow.get_pretrained(str(model_dir), device="cuda")
|
| 80 |
+
finally:
|
| 81 |
+
torch.load = original_load
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
If your local run does not resemble that shape, fix the setup first and only then investigate prompts or solver tuning.
|
| 85 |
+
|
| 86 |
|
| 87 |
## Installation
|
| 88 |
AudioCraft requires Python 3.9, PyTorch 2.1.0. To install AudioCraft, you can run the following:
|
docs/MELODYFLOW.md
CHANGED
|
@@ -22,6 +22,18 @@ If you are running MelodyFlow locally, the main failure mode we hit was not prom
|
|
| 22 |
|
| 23 |
Read the sections below before debugging sampler settings.
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
## Model Card
|
| 27 |
|
|
|
|
| 22 |
|
| 23 |
Read the sections below before debugging sampler settings.
|
| 24 |
|
| 25 |
+
### Known Good Local Shape
|
| 26 |
+
|
| 27 |
+
The local inference path that worked reliably had these pieces:
|
| 28 |
+
|
| 29 |
+
1. a dedicated MelodyFlow Python environment
|
| 30 |
+
2. a local checkout of the official MelodyFlow Space or a maintained fork
|
| 31 |
+
3. a local checkpoint directory for `facebook/melodyflow-t24-30secs`
|
| 32 |
+
4. imports resolved from the Space checkout, not from an older generic AudioCraft clone
|
| 33 |
+
5. a trusted checkpoint load path that can force `weights_only=False` on PyTorch 2.6+
|
| 34 |
+
|
| 35 |
+
If any of those pieces differ, treat that as a setup issue first.
|
| 36 |
+
|
| 37 |
|
| 38 |
## Model Card
|
| 39 |
|