From e64bd8ad339a6c13966e891a0fc40111e80a5375 Mon Sep 17 00:00:00 2001 From: FL33TW00D Date: Tue, 17 Sep 2024 21:34:40 +0100 Subject: [PATCH] chore: flag --- moshi_mlx/moshi_mlx/local_web.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/moshi_mlx/moshi_mlx/local_web.py b/moshi_mlx/moshi_mlx/local_web.py index b63a9e6..07b785b 100644 --- a/moshi_mlx/moshi_mlx/local_web.py +++ b/moshi_mlx/moshi_mlx/local_web.py @@ -336,8 +336,9 @@ async def handle_root(_): await runner.setup() site = web.TCPSite(runner, args.host, args.port) - log("info", f"opening browser at http://{args.host}:{args.port}") - webbrowser.open(f"http://{args.host}:{args.port}") + if not args.no_browser: + log("info", f"opening browser at http://{args.host}:{args.port}") + webbrowser.open(f"http://{args.host}:{args.port}") await asyncio.gather( recv_loop(), send_loop(), recv_loop2(), send_loop2(), site.start() @@ -361,6 +362,7 @@ def main(): parser.add_argument("--static", type=str) parser.add_argument("--host", default="localhost", type=str) parser.add_argument("--port", default=8998, type=int) + parser.add_argument("--no-browser", action="store_true") args = parser.parse_args()