Update cli.py

This commit is contained in:
ThatLukinhasGuy 2023-11-04 18:25:21 -03:00 committed by GitHub
parent 0a2ff2ba5e
commit df7ba2c5eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,6 @@ def main():
api_parser=subparsers.add_parser("api") api_parser=subparsers.add_parser("api")
api_parser.add_argument("--bind", default="127.0.0.1:1337", help="The bind string.") api_parser.add_argument("--bind", default="127.0.0.1:1337", help="The bind string.")
api_parser.add_argument("--debug", type=bool, default=False, help="Enable verbose logging") api_parser.add_argument("--debug", type=bool, default=False, help="Enable verbose logging")
api_parser.add_argument("--num-threads", type=int, default=8, help="The number of threads.")
api_parser.add_argument("--ignored-providers", nargs="+", choices=[provider.name for provider in IgnoredProviders], api_parser.add_argument("--ignored-providers", nargs="+", choices=[provider.name for provider in IgnoredProviders],
default=[], help="List of providers to ignore when processing request.") default=[], help="List of providers to ignore when processing request.")
subparsers.add_parser("gui", parents=[gui_parser()], add_help=False) subparsers.add_parser("gui", parents=[gui_parser()], add_help=False)
@ -25,7 +24,7 @@ def main():
args = parser.parse_args() args = parser.parse_args()
if args.mode == "api": if args.mode == "api":
controller=Api(g4f, debug=args.debug, list_ignored_providers=args.ignored_providers) controller=Api(g4f, debug=args.debug, list_ignored_providers=args.ignored_providers)
controller.run(args.bind, args.num_threads) controller.run(args.bind)
elif args.mode == "gui": elif args.mode == "gui":
run_gui_args(args) run_gui_args(args)
else: else: