feat: scripts

main
Bingsu 2023-02-09 22:17:58 +09:00
parent 5373352b6e
commit b14e9161a1
3 changed files with 20 additions and 0 deletions

4
scripts/install.py Normal file
View File

@ -0,0 +1,4 @@
import launch
if not launch.is_installed("pycloudflared"):
launch.run_pip("install pycloudflared")

9
scripts/preload.py Normal file
View File

@ -0,0 +1,9 @@
import argparse
def preload(parser: argparse.ArgumentParser):
parser.add_argument(
"--cloudflared",
action="store_true",
help="use trycloudflare, alternative to gradio --share",
)

View File

@ -0,0 +1,7 @@
from pycloudflare import try_cloudflare
from modules.shared import cmd_opts
if cmd_opts.cloudflared:
print("cloudflared detected, trying to connect...")
try_cloudflare(cmd_opts.port)