Skip to content
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

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Conversation

hlohaus
Copy link
Collaborator

@hlohaus hlohaus commented Nov 19, 2024

No description provided.

@hlohaus hlohaus merged commit a0f3ea1 into xtekky:main Nov 19, 2024
1 check passed
Copy link

@github-actions github-actions bot left a 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 the logs 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 the logs 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 = []

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;

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')

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')

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')

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')

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant