Spaces:
Running on Zero
Running on Zero
AndrianBalanescu commited on
Commit ·
e62ffc8
1
Parent(s): ac4a7ec
Add farm token field to widget + recalibrate lyric length to 20s/line
Browse files- widget: add Bearer token input (endpoint needs auth; empty token -> 401)
- engine: endpoint sings ~20s/line not 15s/line (12 lines measured 241s);
180s target now -> 9 lines
- farm token passed in start body -> MINIMAX_REMOTE_TOKEN env
moldovan-qwen/engine/lyricist_engine.py
CHANGED
|
@@ -401,7 +401,7 @@ REGULI CRUCIALE DE COMPOZIȚIE:
|
|
| 401 |
|
| 402 |
# The MiniMax vocal engine sings the lyrics through ONCE at ~15s/line, so
|
| 403 |
# real track duration ≈ line_count × 15s. Size the song to the target.
|
| 404 |
-
target_lines = max(
|
| 405 |
length_spec = (
|
| 406 |
f"\n10. LUNGIME PIESĂ (REGULĂ DE FIER, PRIORITATE MAXIMĂ): exact {target_lines} versuri "
|
| 407 |
f"cântate, NU mai mult. Structură fixă: Intro 1, Verse 1 = 4, Chorus (hook) = 4, "
|
|
@@ -1082,7 +1082,7 @@ REGULI CRUCIALE DE COMPOZIȚIE:
|
|
| 1082 |
|
| 1083 |
# The MiniMax vocal engine sings the lyrics through ONCE at ~15s/line, so
|
| 1084 |
# real track duration ≈ line_count × 15s. Size the song to the target.
|
| 1085 |
-
target_lines = max(
|
| 1086 |
user_prompt += (
|
| 1087 |
f"\nLUNGIME (REGULĂ DE FIER, PRIORITATE MAXIMĂ): EXACT {target_lines} versuri cântate, "
|
| 1088 |
f"scurt și catchy, cu repetiție în refren. NU poveste, NU telenovelă, NU mai mult de "
|
|
|
|
| 401 |
|
| 402 |
# The MiniMax vocal engine sings the lyrics through ONCE at ~15s/line, so
|
| 403 |
# real track duration ≈ line_count × 15s. Size the song to the target.
|
| 404 |
+
target_lines = max(6, min(14, int(round(duration_seconds / 20.0))))
|
| 405 |
length_spec = (
|
| 406 |
f"\n10. LUNGIME PIESĂ (REGULĂ DE FIER, PRIORITATE MAXIMĂ): exact {target_lines} versuri "
|
| 407 |
f"cântate, NU mai mult. Structură fixă: Intro 1, Verse 1 = 4, Chorus (hook) = 4, "
|
|
|
|
| 1082 |
|
| 1083 |
# The MiniMax vocal engine sings the lyrics through ONCE at ~15s/line, so
|
| 1084 |
# real track duration ≈ line_count × 15s. Size the song to the target.
|
| 1085 |
+
target_lines = max(6, min(14, int(round(duration_seconds / 20.0))))
|
| 1086 |
user_prompt += (
|
| 1087 |
f"\nLUNGIME (REGULĂ DE FIER, PRIORITATE MAXIMĂ): EXACT {target_lines} versuri cântate, "
|
| 1088 |
f"scurt și catchy, cu repetiție în refren. NU poveste, NU telenovelă, NU mai mult de "
|
moldovan-qwen/static/index.html
CHANGED
|
@@ -1865,6 +1865,8 @@
|
|
| 1865 |
</div>
|
| 1866 |
<label class="block text-xs"><span class="text-slate-400">Remote MiniMax endpoint</span>
|
| 1867 |
<input id="farmUrl" type="text" value="http://38.128.233.50:8005/v1/audio/music/generate" class="w-full bg-slate-950 border border-slate-800 rounded px-2 py-1 text-slate-200 font-mono"></label>
|
|
|
|
|
|
|
| 1868 |
<div class="flex items-center gap-3 text-xs">
|
| 1869 |
<label class="flex items-center gap-1.5 text-slate-300"><input id="farmLoop" type="checkbox" checked> Loop until stopped</label>
|
| 1870 |
<label class="flex items-center gap-1.5 text-slate-300"><input id="farmNoPb" type="checkbox"> Skip PocketBase</label>
|
|
@@ -2327,6 +2329,7 @@
|
|
| 2327 |
duration: +$('farmDur').value,
|
| 2328 |
model: $('farmModel').value.trim(),
|
| 2329 |
remote_url: $('farmUrl').value.trim(),
|
|
|
|
| 2330 |
loop: $('farmLoop').checked,
|
| 2331 |
no_pb: $('farmNoPb').checked,
|
| 2332 |
};
|
|
|
|
| 1865 |
</div>
|
| 1866 |
<label class="block text-xs"><span class="text-slate-400">Remote MiniMax endpoint</span>
|
| 1867 |
<input id="farmUrl" type="text" value="http://38.128.233.50:8005/v1/audio/music/generate" class="w-full bg-slate-950 border border-slate-800 rounded px-2 py-1 text-slate-200 font-mono"></label>
|
| 1868 |
+
<label class="block text-xs"><span class="text-slate-400">Endpoint token (Bearer)</span>
|
| 1869 |
+
<input id="farmToken" type="text" value="supersecretdev" class="w-full bg-slate-950 border border-slate-800 rounded px-2 py-1 text-slate-200 font-mono" placeholder="supersecretdev"></label>
|
| 1870 |
<div class="flex items-center gap-3 text-xs">
|
| 1871 |
<label class="flex items-center gap-1.5 text-slate-300"><input id="farmLoop" type="checkbox" checked> Loop until stopped</label>
|
| 1872 |
<label class="flex items-center gap-1.5 text-slate-300"><input id="farmNoPb" type="checkbox"> Skip PocketBase</label>
|
|
|
|
| 2329 |
duration: +$('farmDur').value,
|
| 2330 |
model: $('farmModel').value.trim(),
|
| 2331 |
remote_url: $('farmUrl').value.trim(),
|
| 2332 |
+
token: $('farmToken').value.trim(),
|
| 2333 |
loop: $('farmLoop').checked,
|
| 2334 |
no_pb: $('farmNoPb').checked,
|
| 2335 |
};
|