Add server-name and no-autolaunch options
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
@@ -395,5 +396,19 @@ with gr.Blocks(theme="NoCrypt/miku") as app:
|
||||
outputs=[audio_output],
|
||||
)
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"--server-name",
|
||||
type=str,
|
||||
default=None,
|
||||
help="Server name for Gradio app",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no-autolaunch",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Do not launch app automatically",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
app.launch(inbrowser=True)
|
||||
app.launch(inbrowser=not args.no_autolaunch, server_name=args.server_name)
|
||||
|
||||
Reference in New Issue
Block a user