Googlefan
commited on
Commit
•
1fa7b92
1
Parent(s):
043b257
refactor(app.py): adjust path slicing for filename and repo_id
Browse files
app.py
CHANGED
@@ -10,8 +10,8 @@ def load_and_synthesize(text: str, path: str, sdp: float = 0.0, speed: float = 1
|
|
10 |
model = TTSModel.from_path(bert, tokenizer)
|
11 |
uid = "default"
|
12 |
path = path.split("/")
|
13 |
-
filename = path[
|
14 |
-
repo_id = "/".join(path[
|
15 |
model.load_sbv2file_from_path(uid, hf_hub_download(repo_id, filename))
|
16 |
print("All setup is done!")
|
17 |
return model.synthesize(text, uid, 0, sdp, 1.0 / speed)
|
|
|
10 |
model = TTSModel.from_path(bert, tokenizer)
|
11 |
uid = "default"
|
12 |
path = path.split("/")
|
13 |
+
filename = path[2:]
|
14 |
+
repo_id = "/".join(path[:2])
|
15 |
model.load_sbv2file_from_path(uid, hf_hub_download(repo_id, filename))
|
16 |
print("All setup is done!")
|
17 |
return model.synthesize(text, uid, 0, sdp, 1.0 / speed)
|