fix colab runtime error

pull/860/head
stark-eth 2023-03-30 15:25:35 +08:00
parent 1397010773
commit 74f1f6e148
2 changed files with 6 additions and 5 deletions

View File

@ -18,7 +18,6 @@ from control.mkgui.base import Opyrator
from control.mkgui.base.core import name_to_title
from . import schema_utils
from .streamlit_utils import CUSTOM_STREAMLIT_CSS
from pyngrok import ngrok
STREAMLIT_RUNNER_SNIPPET = """
from control.mkgui.base.ui import render_streamlit_ui
@ -60,10 +59,7 @@ def launch_ui(port: int = 8501) -> None:
f"""{python_path} "{sys.executable}" -m streamlit run --server.port={port} --server.headless=True --runner.magicEnabled=False --server.maxUploadSize=50 --browser.gatherUsageStats=False {f.name}""",
shell=True,
)
# Setup a tunnel to the streamlit port 2023
public_url = ngrok.connect(port="2023")
print(public_url)
f.close()
unlink(f.name)

5
run.py
View File

@ -15,6 +15,7 @@ from models.encoder import inference as speacker_encoder
from models.vocoder.hifigan import inference as vocoder
from models.ppg2mel import MelDecoderMOLv2
from utils.f0_utils import compute_f0, f02lf0, compute_mean_std, get_converted_lf0uv
from pyngrok import ngrok
def _build_ppg2mel_model(model_config, model_file, device):
@ -136,6 +137,10 @@ def main():
parser = get_parser()
args = parser.parse_args()
convert(args)
# Setup a tunnel to the streamlit port 2023
public_url = ngrok.connect(port="2023")
print(public_url)
if __name__ == "__main__":
main()