Skip to content

two converter py files needs basicConfig() added#7070

Closed
mofosyne wants to merge 1 commit intoggml-org:masterfrom
mofosyne:add-logging-basic-config
Closed

two converter py files needs basicConfig() added#7070
mofosyne wants to merge 1 commit intoggml-org:masterfrom
mofosyne:add-logging-basic-config

Conversation

@mofosyne
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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:

https://github.com/ggerganov/llama.cpp/blob/92139b90af4841d7fd060b526bdd443b621770ff/.flake8#L4

@mofosyne
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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