Skip to content

Conversation

@Geeks-Sid
Copy link

@Geeks-Sid Geeks-Sid commented Mar 29, 2023

It would be great if python code is appropriately formatted with Black to improve the readability of code while following psf foundation-based guidelines!

Usage is pretty simple:

>black $file_name

Happy to answer any questions :)

🤖 Generated by Copilot at 81b8748

Summary

🎨📝🚚

Reformatted several Python scripts to follow PEP8 style and improve readability. No changes to functionality or logic. The scripts are used to convert different formats of graph models to the GGML format used by llama.cpp.

convert- scripts
PEP8 style and readability
autumn leaves of code

Walkthrough

  • Reformat all Python scripts to follow PEP8 style guide, such as breaking long lines, adding spaces and commas, using double quotes for strings, and adding blank lines between functions (link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link)
  • Change magic numbers to uppercase hex in write_header functions of convert-gpt4all-to-ggml.py, convert-gptq-to-ggml.py, and convert-unversioned-ggml-to-ggml.py for consistency with other scripts (link,link,link)
  • Add comments for rot and ftype parameters in convert-gptq-to-ggml.py for clarity (link,link)
  • Add parentheses around multi-line function signatures and expressions in convert-ggml-to-pth.py and convert-gptq-to-ggml.py for readability (link,link,link)
  • Add brackets around list comprehension in convert-ggml-to-pth.py for consistency (link)
  • Remove unnecessary line breaks in quantize.py for compactness (link,link)

@ggerganov
Copy link
Member

This will have to wait for a while - there are too many pending changes to the python code that I don't want to be delayed by this formatting change

@prusnak
Copy link
Contributor

prusnak commented Mar 30, 2023

This kind of change is not very useful at this moment. Try again in few weeks, when there is not so much development around the Python tooling.

@prusnak prusnak closed this Mar 30, 2023
@prusnak
Copy link
Contributor

prusnak commented Mar 30, 2023

Also, keep an eye on pull requests that modify Python code. You can contribute suggestions by reviewing individual PRs, ensuring that the small changes added to the repository already have proper formatting.

@Geeks-Sid
Copy link
Author

Thanks, I will keep that into account.

Deadsg pushed a commit to Deadsg/llama.cpp that referenced this pull request Dec 19, 2023
…ette-1.6.5

Bump sse-starlette from 1.6.1 to 1.6.5
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