-
-
Notifications
You must be signed in to change notification settings - Fork 13.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add aliases to gui arguments, fix logs variable #2381
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Review by G4F Copilot
Thank you, H Lohaus, for your contribution to the project!
Changes Made:
- Added aliases to GUI arguments
- Fixed the
logs
variable in the debug module
File Changes:
- Modified
g4f/debug.py
to add thelogs
list variable - Modified
gui/client/static/css/style.css
to update the CSS style - Modified
g4f/gui/gui_parser.py
to add aliases for host, port, and debug arguments - Modified
g4f/gui/server/api.py
to adjust thelogs
variable and log handling
The changes look good overall. However, please ensure all changes are tested thoroughly before merging.
Thank you again for your contribution!
Best regards,
G4F Copilot
@@ -6,6 +6,7 @@ | |||
last_model: str = None | |||
version: str = None | |||
log_handler: callable = print | |||
logs: list = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a more descriptive name for the variable logs
to clarify its purpose.
@@ -1060,7 +1060,6 @@ a:-webkit-any-link { | |||
|
|||
.log { | |||
white-space: pre-wrap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider consolidating the font-family property values for better maintainability.
parser.add_argument("-port", type=int, default=8080, help="port") | ||
parser.add_argument("-debug", action="store_true", help="debug mode") | ||
parser.add_argument("--host", type=str, default="0.0.0.0", help="hostname") | ||
parser.add_argument_alias('-h', '--host') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The add_argument_alias
method is not a standard method of argparse.ArgumentParser
. Ensure that this method is properly defined or imported before use.
parser.add_argument("--host", type=str, default="0.0.0.0", help="hostname") | ||
parser.add_argument_alias('-h', '--host') | ||
parser.add_argument("--port", type=int, default=8080, help="port") | ||
parser.add_argument_alias('-p', '--port') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The add_argument_alias
method is not a standard method of argparse.ArgumentParser
. Ensure that this method is properly defined or imported before use.
parser.add_argument("--port", type=int, default=8080, help="port") | ||
parser.add_argument_alias('-p', '--port') | ||
parser.add_argument("--debug", action="store_true", help="debug mode") | ||
parser.add_argument_alias('-d', '--debug') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The add_argument_alias
method is not a standard method of argparse.ArgumentParser
. Ensure that this method is properly defined or imported before use.
parser.add_argument_alias('-p', '--port') | ||
parser.add_argument("--debug", action="store_true", help="debug mode") | ||
parser.add_argument_alias('-d', '--debug') | ||
parser.add_argument_alias('-debug', '--debug') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alias -debug
seems redundant since --debug
already exists. Consider removing this alias to avoid confusion.
No description provided.