From 1f786ae31655f7d1714902e2ac9c3e37c58f35ca Mon Sep 17 00:00:00 2001 From: "weirui.kwr@alibaba-inc.com" Date: Tue, 13 Aug 2024 11:52:18 +0800 Subject: [PATCH] update --- src/agentscope/studio/_app_online.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/agentscope/studio/_app_online.py b/src/agentscope/studio/_app_online.py index 5caf59523..6a23331b4 100644 --- a/src/agentscope/studio/_app_online.py +++ b/src/agentscope/studio/_app_online.py @@ -384,4 +384,12 @@ def set_locale() -> Response: if __name__ == "__main__": + import sys + + if len(sys.argv) > 1: + try: + PORT = int(sys.argv[1]) + except ValueError: + print(f"Invalid port number. Using default port {PORT}.") + _app.run(host="0.0.0.0", port=PORT)