mirror of
https://github.com/babysor/Realtime-Voice-Clone-Chinese.git
synced 2026-02-03 02:23:47 +08:00
Add entry for GUI and revise readme
This commit is contained in:
@@ -82,15 +82,10 @@
|
||||
### 3. 启动程序或工具箱
|
||||
您可以尝试使用以下命令:
|
||||
|
||||
### 3.1 启动Web程序:
|
||||
### 3.1 启动Web程序(v2):
|
||||
`python web.py`
|
||||
运行成功后在浏览器打开地址, 默认为 `http://localhost:8080`
|
||||

|
||||
> 注:目前界面比较buggy,
|
||||
> * 第一次点击`录制`要等待几秒浏览器正常启动录音,否则会有重音
|
||||
> * 录制结束不要再点`录制`而是`停止`
|
||||
> * 仅支持手动新录音(16khz), 不支持超过4MB的录音,最佳长度在5~15秒
|
||||
> * 默认使用第一个找到的模型,有动手能力的可以看代码修改 `web\__init__.py`。
|
||||
|
||||
### 3.2 启动工具箱:
|
||||
`python demo_toolbox.py -d <datasets_root>`
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import os
|
||||
import sys
|
||||
import typer
|
||||
|
||||
cli = typer.Typer()
|
||||
|
||||
@cli.command()
|
||||
def launch_ui(port: int = typer.Option(8051, "--port", "-p")) -> None:
|
||||
"""Start a graphical UI server for the opyrator.
|
||||
|
||||
The UI is auto-generated from the input- and output-schema of the given function.
|
||||
"""
|
||||
# Add the current working directory to the sys path
|
||||
# This is required to resolve the opyrator path
|
||||
sys.path.append(os.getcwd())
|
||||
|
||||
from mkgui.base.ui.streamlit_ui import launch_ui
|
||||
launch_ui(port)
|
||||
|
||||
if __name__ == "__main__":
|
||||
cli()
|
||||
26
web.py
26
web.py
@@ -1,11 +1,21 @@
|
||||
from web import webApp
|
||||
from gevent import pywsgi as wsgi
|
||||
import os
|
||||
import sys
|
||||
import typer
|
||||
|
||||
cli = typer.Typer()
|
||||
|
||||
@cli.command()
|
||||
def launch_ui(port: int = typer.Option(8080, "--port", "-p")) -> None:
|
||||
"""Start a graphical UI server for the opyrator.
|
||||
|
||||
The UI is auto-generated from the input- and output-schema of the given function.
|
||||
"""
|
||||
# Add the current working directory to the sys path
|
||||
# This is required to resolve the opyrator path
|
||||
sys.path.append(os.getcwd())
|
||||
|
||||
from mkgui.base.ui.streamlit_ui import launch_ui
|
||||
launch_ui(port)
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = webApp()
|
||||
host = app.config.get("HOST")
|
||||
port = app.config.get("PORT")
|
||||
print(f"Web server: http://{host}:{port}")
|
||||
server = wsgi.WSGIServer((host, port), app)
|
||||
server.serve_forever()
|
||||
cli()
|
||||
Reference in New Issue
Block a user