Spaces:
Running
Running
Merge pull request #218 from jhj0517/refactor/edit-args
Browse files
app.py
CHANGED
@@ -304,20 +304,18 @@ class App:
|
|
304 |
outputs=None)
|
305 |
|
306 |
# Launch the app with optional gradio settings
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
self.app.queue(api_open=False).launch(**launch_args)
|
321 |
|
322 |
@staticmethod
|
323 |
def open_folder(folder_path: str):
|
@@ -347,7 +345,8 @@ parser.add_argument('--username', type=str, default=None, help='Gradio authentic
|
|
347 |
parser.add_argument('--password', type=str, default=None, help='Gradio authentication password')
|
348 |
parser.add_argument('--theme', type=str, default=None, help='Gradio Blocks theme')
|
349 |
parser.add_argument('--colab', type=bool, default=False, nargs='?', const=True, help='Is colab user or not')
|
350 |
-
parser.add_argument('--api_open', type=bool, default=False, nargs='?', const=True, help='
|
|
|
351 |
parser.add_argument('--whisper_model_dir', type=str, default=os.path.join("models", "Whisper"),
|
352 |
help='Directory path of the whisper model')
|
353 |
parser.add_argument('--faster_whisper_model_dir', type=str, default=os.path.join("models", "Whisper", "faster-whisper"),
|
|
|
304 |
outputs=None)
|
305 |
|
306 |
# Launch the app with optional gradio settings
|
307 |
+
args = self.args
|
308 |
+
|
309 |
+
self.app.queue(
|
310 |
+
api_open=args.api_open
|
311 |
+
).launch(
|
312 |
+
share=args.share,
|
313 |
+
server_name=args.server_name,
|
314 |
+
server_port=args.server_port,
|
315 |
+
auth=(args.username, args.password) if args.username and args.password else None,
|
316 |
+
root_path=args.root_path,
|
317 |
+
inbrowser=args.inbrowser
|
318 |
+
)
|
|
|
|
|
319 |
|
320 |
@staticmethod
|
321 |
def open_folder(folder_path: str):
|
|
|
345 |
parser.add_argument('--password', type=str, default=None, help='Gradio authentication password')
|
346 |
parser.add_argument('--theme', type=str, default=None, help='Gradio Blocks theme')
|
347 |
parser.add_argument('--colab', type=bool, default=False, nargs='?', const=True, help='Is colab user or not')
|
348 |
+
parser.add_argument('--api_open', type=bool, default=False, nargs='?', const=True, help='Enable api or not in Gradio')
|
349 |
+
parser.add_argument('--inbrowser', type=bool, default=True, nargs='?', const=True, help='Whether to automatically start Gradio app or not')
|
350 |
parser.add_argument('--whisper_model_dir', type=str, default=os.path.join("models", "Whisper"),
|
351 |
help='Directory path of the whisper model')
|
352 |
parser.add_argument('--faster_whisper_model_dir', type=str, default=os.path.join("models", "Whisper", "faster-whisper"),
|