summaryrefslogtreecommitdiffstats
path: root/g4f/gui/run.py
diff options
context:
space:
mode:
authorArran Hobson Sayers <ahobsonsayers@gmail.com>2023-10-12 03:35:11 +0200
committerArran Hobson Sayers <ahobsonsayers@gmail.com>2023-10-12 03:35:11 +0200
commit77697be33381a01350d0818ff069469faea2f4ac (patch)
tree418bfd7e3a9d01b94a6dcc3077c96ca87e674e73 /g4f/gui/run.py
parent~ (diff)
downloadgpt4free-77697be33381a01350d0818ff069469faea2f4ac.tar
gpt4free-77697be33381a01350d0818ff069469faea2f4ac.tar.gz
gpt4free-77697be33381a01350d0818ff069469faea2f4ac.tar.bz2
gpt4free-77697be33381a01350d0818ff069469faea2f4ac.tar.lz
gpt4free-77697be33381a01350d0818ff069469faea2f4ac.tar.xz
gpt4free-77697be33381a01350d0818ff069469faea2f4ac.tar.zst
gpt4free-77697be33381a01350d0818ff069469faea2f4ac.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)