Spaces:
Runtime error
Runtime error
change default audio model
Browse files- txt2video.py +14 -8
txt2video.py
CHANGED
@@ -51,21 +51,27 @@ def main(job_id, text, video_url):
|
|
51 |
|
52 |
def gen_voice(text, audio_path):
|
53 |
ogg_path = Path(audio_path).with_suffix('.ogg')
|
54 |
-
client = Client("https://digitalxingtong-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
result = client.predict(
|
56 |
-
|
57 |
-
|
58 |
0.2, # int | float (numeric value between 0 and 1) in 'θ―θ°εε' Slider component
|
59 |
0.6, # int | float (numeric value between 0.1 and 1.5) in 'ζζ
εε' Slider component
|
60 |
0.8, # int | float (numeric value between 0.1 and 1.4) in 'ι³θει³ιΏεΊ¦εε' Slider component
|
61 |
-
|
62 |
fn_index=0
|
63 |
)
|
64 |
-
|
65 |
-
|
66 |
-
print(
|
67 |
shutil.move(audio_file, audio_path)
|
68 |
-
shutil.move(ogg_file, ogg_path)
|
69 |
|
70 |
|
71 |
if __name__ == '__main__':
|
|
|
51 |
|
52 |
def gen_voice(text, audio_path):
|
53 |
ogg_path = Path(audio_path).with_suffix('.ogg')
|
54 |
+
client = Client("https://digitalxingtong-ign-longread-bert-vits2.hf.space/")
|
55 |
+
if os.path.isabs(text):
|
56 |
+
path = text
|
57 |
+
else:
|
58 |
+
current_folder = os.path.dirname(os.path.abspath(__file__))
|
59 |
+
path = os.path.join(current_folder, 'input.txt')
|
60 |
+
with open(path, 'w') as file:
|
61 |
+
file.write(text)
|
62 |
result = client.predict(
|
63 |
+
path,
|
64 |
+
# str (filepath or URL to file) in 'ε¨θΏιδΈδΌ TXTζδ»Ά' File component
|
65 |
0.2, # int | float (numeric value between 0 and 1) in 'θ―θ°εε' Slider component
|
66 |
0.6, # int | float (numeric value between 0.1 and 1.5) in 'ζζ
εε' Slider component
|
67 |
0.8, # int | float (numeric value between 0.1 and 1.4) in 'ι³θει³ιΏεΊ¦εε' Slider component
|
68 |
+
0.95, # int | float (numeric value between 0.1 and 2) in 'θ―ι' Slider component
|
69 |
fn_index=0
|
70 |
)
|
71 |
+
|
72 |
+
audio_file = result
|
73 |
+
print(audio_file)
|
74 |
shutil.move(audio_file, audio_path)
|
|
|
75 |
|
76 |
|
77 |
if __name__ == '__main__':
|