Spaces:
Running on Zero
Running on Zero
Original-backing version: each song's vocals over the rearranged 1987 backing, as a second track
7defe51 verified Download deploy/runpod/worker/engine/empty-style.patch from paleocybernetic/rickroll-test: direct link, hf CLI and curl.
- Browser
- Download file 2.05 kB
-
https://huggingface.co/spaces/paleocybernetic/rickroll-test/resolve/main/deploy/runpod/worker/engine/empty-style.patch
- Command line
-
hf download hf://spaces/paleocybernetic/rickroll-test/deploy/runpod/worker/engine/empty-style.patch
-
curl -L -o empty-style.patch https://huggingface.co/spaces/paleocybernetic/rickroll-test/resolve/main/deploy/runpod/worker/engine/empty-style.patch
2.05 kB
| --- a/engine/src/yue2/yue2-request.h | |
| +++ b/engine/src/yue2/yue2-request.h | |
| yyjson_doc_free(doc); | |
| return false; | |
| } | |
| - if ((!present || out->style.empty()) && !yyjson_obj_get(root, "songs")) { | |
| + const bool style_present = present; | |
| + if (!style_present && (yyjson_obj_get(root, "style") || !yyjson_obj_get(root, "songs"))) { | |
| if (err) { | |
| - *err = "\"style\" is required and must be non-empty"; | |
| + *err = "\"style\" is required and must be a string"; | |
| } | |
| yyjson_doc_free(doc); | |
| return false; | |
| } | |
| Yue2SongSpec spec; | |
| bool sp = false; | |
| - if (!yue2_req_str(sv, "style", &spec.style, &sp, err) || !yue2_req_str(sv, "lyrics", &spec.lyrics, &sp, err) || | |
| + bool song_style_present = false; | |
| + if (!yue2_req_str(sv, "style", &spec.style, &song_style_present, err) || | |
| + !yue2_req_str(sv, "lyrics", &spec.lyrics, &sp, err) || | |
| !yue2_req_str(sv, "abc", &spec.abc, &sp, err)) { | |
| yyjson_doc_free(doc); | |
| return false; | |
| } | |
| spec.abc_provided = !spec.abc.empty(); | |
| - if (spec.style.empty()) { | |
| - if (err) *err = "\"songs\" entry " + std::to_string(idx) + " needs a non-empty \"style\""; | |
| + if (!song_style_present) { | |
| + if (err) *err = "\"songs\" entry " + std::to_string(idx) + " needs a \"style\" string"; | |
| yyjson_doc_free(doc); | |
| return false; | |
| } | |
| out->lm_batch_size = (int) out->songs.size(); | |
| // The top-level prompt is what /yue2/props-style validators and the | |
| // log lines read; the first song stands in for it when absent. | |
| - if (out->style.empty()) out->style = out->songs[0].style; | |
| + if (!style_present) out->style = out->songs[0].style; | |
| if (out->lyrics.empty()) out->lyrics = out->songs[0].lyrics; | |
| } | |