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

two converter py files needs basicConfig() added #7070

Closed
wants to merge 1 commit into from

Conversation

mofosyne
Copy link
Collaborator

@mofosyne mofosyne commented May 4, 2024

Address for now an issue of two .py file not printing #6511 (comment)

Also made a py file executable.

This is a stopgap fix until ArgumentParser() is added so its easier to add --verbose mode (which I won't be doing yet, so others can give it a shot)

@mofosyne
Copy link
Collaborator Author

mofosyne commented May 4, 2024

@ggerganov you can merge this in or just copy and paste to your working repo to get going again.

@mofosyne mofosyne force-pushed the add-logging-basic-config branch from 35f98ff to 3f96d53 Compare May 4, 2024 05:26
@ggerganov
Copy link
Owner

Thanks, I did something similar already in #7036

I've blacklisted 2 scripts from the lint because the prints in those need to be alone on the line without function prefix. If there is a way to fix this and still use the logger, we re-enable the lint:

exclude = examples/*,examples/*/**,*/**/__init__.py,scripts/gen-unicode-data.py,tests/test-tokenizer-0.py

@mofosyne
Copy link
Collaborator Author

mofosyne commented May 4, 2024

@ggerganov

if it's just a line or two then you can use # noqa: <flake8 code> on each offending line. Obviously it get's unwieldy fast if there is too many, but at least it gives you an option without blacklisting entire scripts

Refer to https://flake8.pycqa.org/en/latest/user/violations.html#in-line-ignoring-errors for more information

@mofosyne mofosyne closed this May 4, 2024
@mofosyne
Copy link
Collaborator Author

mofosyne commented May 4, 2024

Closing as @ggerganov already did it, but note that he may still want to set the chmod for that script and fix convert-lora-to-ggml.py as well.

@teleprint-me
Copy link
Contributor

teleprint-me commented May 4, 2024

As a FYI, you can ignore exclude paths by just specifying them.

[flake8]
max-line-length = 125
ignore = E203,E211,E221,E225,E231,E241,E251,E261,E266,E501,E701,E704,W503
- exclude = examples/*,examples/*/**,*/**/__init__.py
+ exclude =
+     # Do not traverse examples
+     examples,
+     # Do not include package initializers
+     __init__.py,
+     # No need to traverse our git directory
+     .git,
+     # There's no value in checking cache directories
+     __pycache__,
+     # No need to include the build path
+     build,
+     # This contains builds that we don't want to check
+     dist  # This is generated with `python build .` for package releases
+ # max-complexity = 10

Makes easier to read and maintain.

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.

3 participants