Spaces:
Running
on
Zero
Running
on
Zero
Delete deploy.py
Browse files
deploy.py
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
import logging
|
2 |
-
import subprocess
|
3 |
-
logging.basicConfig(level=logging.INFO)
|
4 |
-
|
5 |
-
def run_shell_script(script_path):
|
6 |
-
"""
|
7 |
-
运行指定路径的shell脚本,并打印输出到控制台。
|
8 |
-
|
9 |
-
:param script_path: Shell脚本的文件路径
|
10 |
-
"""
|
11 |
-
try:
|
12 |
-
# 使用subprocess.Popen来运行shell脚本
|
13 |
-
with subprocess.Popen(['bash', script_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) as proc:
|
14 |
-
# 读取输出
|
15 |
-
for line in proc.stdout:
|
16 |
-
print(line, end='') # 实时打印输出
|
17 |
-
proc.stdout.close()
|
18 |
-
return_code = proc.wait()
|
19 |
-
if return_code:
|
20 |
-
print(f"Shell脚本运行出错,返回码:{return_code}")
|
21 |
-
except Exception as e:
|
22 |
-
print(f"运行shell脚本时发生错误:{e}")
|
23 |
-
|
24 |
-
# 使用方法示例
|
25 |
-
# 假设有一个名为example.sh的脚本文件在当前目录下
|
26 |
-
run_shell_script('deploy.sh')
|
27 |
-
|
28 |
-
class args:
|
29 |
-
def __init__(self):
|
30 |
-
self.port = 5000
|
31 |
-
|
32 |
-
from CosyVoice.webui import main
|
33 |
-
from CosyVoice.cosyvoice.cli.cosyvoice import CosyVoice
|
34 |
-
import numpy as np
|
35 |
-
|
36 |
-
cosyvoice = CosyVoice("pretrained_models/CosyVoice-300M")
|
37 |
-
sft_spk = cosyvoice.list_avaliable_spks()
|
38 |
-
prompt_sr, target_sr = 16000, 22050
|
39 |
-
default_data = np.zeros(target_sr)
|
40 |
-
args.port = 5000
|
41 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|