mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-07 23:48:48 +08:00
clean path
This commit is contained in:
parent
8d0cf0f8a9
commit
d776ff6bd3
@ -25,7 +25,9 @@ def load_audio(file, sr):
|
|||||||
return np.frombuffer(out, np.float32).flatten()
|
return np.frombuffer(out, np.float32).flatten()
|
||||||
|
|
||||||
|
|
||||||
def clean_path(path_str):
|
def clean_path(path_str:str):
|
||||||
|
if path_str.endswith(('\\','/')):
|
||||||
|
return clean_path(path_str[0:-1])
|
||||||
if platform.system() == 'Windows':
|
if platform.system() == 'Windows':
|
||||||
path_str = path_str.replace('/', '\\')
|
path_str = path_str.replace('/', '\\')
|
||||||
return path_str.strip(" ").strip('"').strip("\n").strip('"').strip(" ").strip("\u202a")
|
return path_str.strip(" ").strip('"').strip("\n").strip('"').strip(" ").strip("\u202a")
|
Loading…
x
Reference in New Issue
Block a user