Spaces:
Runtime error
Runtime error
root commited on
Commit ·
af26727
1
Parent(s): 0d58c27
fix some description
Browse filesFiles changed (4)
- LICENSE+1-1
- README.md+1-1
- app.py+6-1
- download.py+2-2
123456Tencent is pleased to support the open source community by making SongGeneration available.Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.SongGeneration is licensed under the License Terms of SongGeneration except for the third-party components listed below, which is licensed under different terms. SongGeneration does not impose any additional limitations beyond what is outlined in the respective licenses of these third-party components. Users must comply with all terms and conditions of original licenses of these third-party components and must ensure that the usage of the third party components adheres to all relevant laws and regulations.123456Tencent is pleased to support the open source community by making SongGeneration available.Copyright (C) 2025 Tencent. All rights reserved.SongGeneration is licensed under the License Terms of SongGeneration except for the third-party components listed below, which is licensed under different terms. SongGeneration does not impose any additional limitations beyond what is outlined in the respective licenses of these third-party components. Users must comply with all terms and conditions of original licenses of these third-party components and must ensure that the usage of the third party components adheres to all relevant laws and regulations.
25 unmodified lines2627282925 unmodified lines## LicenseThe code and weights in this repository is released under the MIT license as found in the [LICENSE](LICENSE) file.25 unmodified lines2627282925 unmodified lines## LicenseThe code and weights in this repository is released in the [LICENSE](LICENSE) file.
60 unmodified lines6162636465662 unmodified lines6970717273747576777879807 unmodified lines88899091929360 unmodified linesglobal STRUCTSparams = {'cfg_coef':cfg_coef, 'temperature':temperature, 'top_k':top_k}params = {k:v for k,v in params.items() if v is not None}sample_rate = MODEL.cfg.sample_rate# format lyric2 unmodified linesif len(paragraphs) < 1:return None, json.dumps("Lyrics can not be left blank")paragraphs_norm = []for para in paragraphs:lines = para.splitlines()struct_tag = lines[0].strip().lower()if struct_tag not in STRUCTS:return None, json.dumps(f"Segments should start with a structure tag in {STRUCTS}")if struct_tag in ['[verse]', '[chorus]', '[bridge]']:if len(lines) < 2 or not [line.strip() for line in lines[1:] if line.strip()]:return None, json.dumps("The following segments require lyrics: [verse], [chorus], [bridge]")else:7 unmodified lineselse:new_para_str = struct_tagparagraphs_norm.append(new_para_str)lyric_norm = " ; ".join(paragraphs_norm)# format prompt60 unmodified lines616263646566672 unmodified lines70717273747576777879808182837 unmodified lines919293949596979860 unmodified linesglobal STRUCTSparams = {'cfg_coef':cfg_coef, 'temperature':temperature, 'top_k':top_k}params = {k:v for k,v in params.items() if v is not None}vocal_structs = ['[verse]', '[chorus]', '[bridge]']sample_rate = MODEL.cfg.sample_rate# format lyric2 unmodified linesif len(paragraphs) < 1:return None, json.dumps("Lyrics can not be left blank")paragraphs_norm = []vocal_flag = Falsefor para in paragraphs:lines = para.splitlines()struct_tag = lines[0].strip().lower()if struct_tag not in STRUCTS:return None, json.dumps(f"Segments should start with a structure tag in {STRUCTS}")if struct_tag in vocal_structs:vocal_flag = Trueif len(lines) < 2 or not [line.strip() for line in lines[1:] if line.strip()]:return None, json.dumps("The following segments require lyrics: [verse], [chorus], [bridge]")else:7 unmodified lineselse:new_para_str = struct_tagparagraphs_norm.append(new_para_str)if not vocal_flag:return None, json.dumps(f"The lyric must contain at least one of the following structures: {vocal_structs}")lyric_norm = " ; ".join(paragraphs_norm)# format prompt
1 unmodified line23456789101112131 unmodified lineimport osdef download_model(local_dir):repo_id = "waytan22/SongGeneration-LeVo"downloaded_path = snapshot_download(repo_id=repo_id,local_dir=local_dir,revision="6a0dd87",token=os.environ.get("HF_TOKEN"),ignore_patterns=['.git*'])1 unmodified line23456789101112131 unmodified lineimport osdef download_model(local_dir):repo_id = "tencent/SongGeneration"downloaded_path = snapshot_download(repo_id=repo_id,local_dir=local_dir,revision="de30f7b",token=os.environ.get("HF_TOKEN"),ignore_patterns=['.git*'])
LICENSE+1-1
README.md+1-1
app.py+6-1
download.py+2-2