| import subprocess, sys, re, cloudpickle, shlex | |
| from pathlib import Path | |
| port = 7860 | |
| tunnel_class = cloudpickle.load(open("/kaggle/working/new_tunnel", "rb"), encoding="utf-8") | |
| tunnel = tunnel_class(port) | |
| tunnel.add_tunnel(command=f"cl tunnel --url localhost:{port}", name="cl", pattern=re.compile(r"[\w-]+\.trycloudflare\.com")) | |
| asd = f'/kaggle/venv/bin/python3 launch.py {" ".join(sys.argv[1:])}' | |
| with tunnel: | |
| subprocess.call(shlex.split(asd)) |