thecollabagepatch commited on
Commit
7a78fee
Β·
1 Parent(s): e5eaa7e

Track media with Git LFS; add lil_demo_540p.mp4

Browse files
Files changed (3) hide show
  1. .gitattributes +3 -0
  2. documentation.html +79 -7
  3. lil_demo_540p.mp4 +3 -0
.gitattributes CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
37
+ *.mov filter=lfs diff=lfs merge=lfs -text
38
+ *.wav filter=lfs diff=lfs merge=lfs -text
documentation.html CHANGED
@@ -100,22 +100,94 @@
100
  <body>
101
  <div class="header">
102
  <h1>🎡 MagentaRT Research API</h1>
103
- <p class="muted"><strong>AI Music Generation API</strong> β€’ Real-time streaming β€’ Custom fine-tuning support</p>
104
  <span class="badge">Research Project</span>
105
  </div>
106
 
107
- <div class="demo-placeholder">
108
- <h3>πŸ“± App Demo Video</h3>
109
- <p>Demo video will be embedded here<br>
110
- <small>Showing the iPhone app generating music in real-time</small></p>
 
 
 
 
 
 
 
 
 
 
 
 
111
  </div>
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  <div class="section">
114
  <h2>Overview</h2>
115
- <p>This API powers AI music generation using Google's MagentaRT, designed for real-time audio streaming and custom model fine-tuning. Built for iOS app integration with WebSocket streaming support.</p>
116
 
117
  <div class="info">
118
- <strong>Hardware Requirements:</strong> Optimal performance requires an L40S GPU (48GB VRAM) for real-time streaming. L4 24GB works but may not maintain real-time performance.
119
  </div>
120
  </div>
121
 
 
100
  <body>
101
  <div class="header">
102
  <h1>🎡 MagentaRT Research API</h1>
103
+ <p class="muted"><strong>AI Music Generation API</strong> β€’ Real-time streaming β€’ Custom fine-tune support</p>
104
  <span class="badge">Research Project</span>
105
  </div>
106
 
107
+ <section id="env-vars" style="margin-top: 24px;">
108
+ <h3>βš™οΈ Environment variables (optional, but helpful)</h3>
109
+ <p>
110
+ You can boot this Space directly into your own finetune by setting the variables below in
111
+ <em>Settings β†’ Variables and secrets β†’ Variables</em>. If you don't set them, you can still
112
+ select models at runtime using <code>/model/select</code> from the frontend/API.
113
+ </p>
114
+
115
+ <div class="callout" style="padding:12px;border:1px solid #e0e0e0;border-radius:8px;background:#fafafa;margin:16px 0;">
116
+ <strong>Quick start:</strong> set these to make a finetune the default on boot:
117
+ <ul style="margin:8px 0 0 18px;">
118
+ <li><code>MRT_CKPT_REPO</code> β†’ <code>thepatch/magenta-ft</code></li>
119
+ <li><code>MRT_CKPT_STEP</code> β†’ <code>1863001</code></li>
120
+ <li><code>MRT_SIZE</code> β†’ <code>large</code></li>
121
+ </ul>
122
+ <p style="margin:8px 0 0 0;"><small>Those values correspond to the example finetune in this repo (checkpoint_1863001.tgz on top of the <em>large</em> base).</small></p>
123
  </div>
124
 
125
+ <table class="var-table" style="width:100%;border-collapse:collapse;margin:12px 0;">
126
+ <thead>
127
+ <tr>
128
+ <th style="text-align:left;border-bottom:1px solid #ddd;padding:8px;">Name</th>
129
+ <th style="text-align:left;border-bottom:1px solid #ddd;padding:8px;">What it does</th>
130
+ <th style="text-align:left;border-bottom:1px solid #ddd;padding:8px;">Example</th>
131
+ <th style="text-align:left;border-bottom:1px solid #ddd;padding:8px;">When to set</th>
132
+ </tr>
133
+ </thead>
134
+ <tbody>
135
+ <tr>
136
+ <td style="padding:8px;border-bottom:1px solid #eee;"><code>MRT_CKPT_REPO</code></td>
137
+ <td style="padding:8px;border-bottom:1px solid #eee;">Hugging Face repo ID that hosts your finetune checkpoints/assets.</td>
138
+ <td style="padding:8px;border-bottom:1px solid #eee;"><code>thepatch/magenta-ft</code></td>
139
+ <td style="padding:8px;border-bottom:1px solid #eee;">Set to make this finetune the default on boot.</td>
140
+ </tr>
141
+ <tr>
142
+ <td style="padding:8px;border-bottom:1px solid #eee;"><code>MRT_CKPT_STEP</code></td>
143
+ <td style="padding:8px;border-bottom:1px solid #eee;">Checkpoint step number to load on boot.</td>
144
+ <td style="padding:8px;border-bottom:1px solid #eee;"><code>1863001</code></td>
145
+ <td style="padding:8px;border-bottom:1px solid #eee;">Set if you want a specific checkpoint preselected.</td>
146
+ </tr>
147
+ <tr>
148
+ <td style="padding:8px;border-bottom:1px solid #eee;"><code>MRT_SIZE</code></td>
149
+ <td style="padding:8px;border-bottom:1px solid #eee;">Base model family used by the finetune (e.g., <em>large</em>).</td>
150
+ <td style="padding:8px;border-bottom:1px solid #eee;"><code>large</code></td>
151
+ <td style="padding:8px;border-bottom:1px solid #eee;">Set to match the base you finetuned from.</td>
152
+ </tr>
153
+ <tr>
154
+ <td style="padding:8px;border-bottom:1px solid #eee;"><code>SPACE_MODE</code></td>
155
+ <td style="padding:8px;border-bottom:1px solid #eee;">Controls readiness behavior: <code>serve</code> (GPU, ready to generate) vs <code>template</code> (CPU template for duplication). If unset, the server auto-detects.</td>
156
+ <td style="padding:8px;border-bottom:1px solid #eee;"><code>serve</code> or <code>template</code></td>
157
+ <td style="padding:8px;border-bottom:1px solid #eee;">Set for explicit behavior; otherwise it falls back to auto-detection.</td>
158
+ </tr>
159
+ </tbody>
160
+ </table>
161
+
162
+ <details style="margin-top:12px;">
163
+ <summary><strong>Alternative: select a model at runtime via API</strong></summary>
164
+ <pre style="background:#111;color:#eee;padding:12px;border-radius:8px;overflow:auto;margin-top:8px;"><code style="background: transparent; color: inherit; padding: 0; border: 0; box-shadow: none; display: block;">curl -X POST https://&lt;your-space&gt;.hf.space/model/select \
165
+ -H 'Content-Type: application/json' \
166
+ -d '{
167
+ "ckpt_repo": "thepatch/magenta-ft",
168
+ "ckpt_step": 1863001,
169
+ "size": "large",
170
+ "prewarm": true
171
+ }'</code></pre>
172
+ <p style="margin:8px 0 0 0;"><small>When you call <code>prewarm:true</code>, the backend performs a bar-aligned warmup before returning, so the first jam starts hot.</small></p>
173
+ </details>
174
+ </section>
175
+
176
+ <div class="demo-placeholder">
177
+ <h3>πŸ“± App Demo Video</h3>
178
+ <video controls preload="metadata" playsinline style="width:100%; border-radius:8px;">
179
+ <source src="./lil_demo_540p.mp4" type="video/mp4">
180
+ Your browser does not support the video tag.
181
+ </video>
182
+ <p class="muted"><small>iPhone app generating music in real-time</small></p>
183
+ </div>
184
+
185
  <div class="section">
186
  <h2>Overview</h2>
187
+ <p>This API powers AI music generation using Google's MagentaRT, designed for real-time audio streaming using finetunes hosted on HF. Built for iOS app integration with WebSocket streaming support.</p>
188
 
189
  <div class="info">
190
+ <strong>Hardware Requirements:</strong> Optimal performance requires an L40S GPU (48GB VRAM) for real-time streaming. L4 24GB almost works but will not achieve real-time performance (if someone knows an optimization that will solve this, please let me know).
191
  </div>
192
  </div>
193
 
lil_demo_540p.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e5e5e2fb9448c2474c5c413cd7b2fa00d0f03585aeedcc91458291cb57c3dc1
3
+ size 3390975