From 3f0f45e76ea1fd13b51177c4a356058a3b8648e2 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 10 Sep 2024 14:42:40 +0800 Subject: [PATCH] add clean score option --- infer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infer.py b/infer.py index 2bbd7bd..921b674 100644 --- a/infer.py +++ b/infer.py @@ -130,6 +130,7 @@ def generate_music( fix_pitch=True, fix_std=True, fix_volume=True, + clean_score=False, ): patchilizer = Patchilizer() patch_config = GPT2Config( @@ -302,7 +303,7 @@ def generate_music( xml = abc2xml(tunes, f"{outdir}/[{emo}]{timestamp}.musicxml") audio = xml2(xml, "wav") - if os.path.exists(xml): + if os.path.exists(xml) and clean_score: os.remove(xml) if os.path.exists(audio):