summaryrefslogtreecommitdiffstats
path: root/g4f/gui/run.py
diff options
context:
space:
mode:
authorTekky <98614666+xtekky@users.noreply.github.com>2023-10-12 15:32:50 +0200
committerGitHub <noreply@github.com>2023-10-12 15:32:50 +0200
commit86248b44bcb4261c627335e24f5713e242793ece (patch)
tree59671d1777b76bade80b4a0c5ce8a42121878a9e /g4f/gui/run.py
parent~ | Merge pull request #1053 from Lin-jun-xiang/fix_GptGo (diff)
parentchange "Models" to "Providers" (diff)
downloadgpt4free-86248b44bcb4261c627335e24f5713e242793ece.tar
gpt4free-86248b44bcb4261c627335e24f5713e242793ece.tar.gz
gpt4free-86248b44bcb4261c627335e24f5713e242793ece.tar.bz2
gpt4free-86248b44bcb4261c627335e24f5713e242793ece.tar.lz
gpt4free-86248b44bcb4261c627335e24f5713e242793ece.tar.xz
gpt4free-86248b44bcb4261c627335e24f5713e242793ece.tar.zst
gpt4free-86248b44bcb4261c627335e24f5713e242793ece.zip
Diffstat (limited to 'g4f/gui/run.py')
-rw-r--r--g4f/gui/run.py30
1 files changed, 18 insertions, 12 deletions
diff --git a/g4f/gui/run.py b/g4f/gui/run.py
index 731c7cbf..0f94814c 100644
--- a/g4f/gui/run.py
+++ b/g4f/gui/run.py
@@ -1,18 +1,24 @@
-from g4f.gui import run_gui
from argparse import ArgumentParser
+from g4f.gui import run_gui
-if __name__ == '__main__':
-
- parser = ArgumentParser(description='Run the GUI')
-
- parser.add_argument('-host', type=str, default='0.0.0.0', help='hostname')
- parser.add_argument('-port', type=int, default=80, help='port')
- parser.add_argument('-debug', action='store_true', help='debug mode')
- args = parser.parse_args()
- port = args.port
+def gui_parser():
+ parser = ArgumentParser(description="Run the GUI")
+ parser.add_argument("-host", type=str, default="0.0.0.0", help="hostname")
+ parser.add_argument("-port", type=int, default=80, help="port")
+ parser.add_argument("-debug", action="store_true", help="debug mode")
+ return parser
+
+
+def run_gui_args(args):
host = args.host
+ port = args.port
debug = args.debug
-
- run_gui(host, port, debug) \ No newline at end of file
+ run_gui(host, port, debug)
+
+
+if __name__ == "__main__":
+ parser = gui_parser()
+ args = parser.parse_args()
+ run_gui_args(args)