Cleaned ngrok integration

This commit is contained in:
JamnedZ
2022-10-11 16:40:27 +07:00
committed by AUTOMATIC1111
parent 4e485b7923
commit 5992564448
3 changed files with 21 additions and 0 deletions

View File

@@ -51,6 +51,11 @@ if not cmd_opts.share and not cmd_opts.listen:
gradio.utils.version_check = lambda: None
gradio.utils.get_local_ip_address = lambda: '127.0.0.1'
if cmd_opts.ngrok != None:
import modules.ngrok as ngrok
print('ngrok authtoken detected, trying to connect...')
ngrok.connect(cmd_opts.ngrok, cmd_opts.port if cmd_opts.port != None else 7860)
def gr_show(visible=True):
return {"visible": visible, "__type__": "update"}