Skip to main content

Generate git commit message using fine-tuned LLM

Project description

git-gen

PyPI - Version PyPI - Python Version

Generate git commit message with a local LLM, which has been fine-tuned on 300K high-quality Python commits and is able to analyze the purposes of the changes

Installation

Required Python 3.10+
To install this package, run:

pip install git-gen

Uses

To generate git commit message in current working directory, run:

git-gen

Generate with custom config:

git-gen --temperature 0.2 --top_k 50 --top_p 0.7

To get all command options, run:

git-gen -h

which should output

Usage:  [OPTIONS]

Options:
  --path PATH                 Path to the project, which should contain a '.git' folder. Default to current working directory.
  --max_tokens INTEGER RANGE  The maximum numbers of tokens to generate.  [default: 1024; x>=1]
  --temperature FLOAT RANGE   Control the overall probabilities of the generation. Prefer lower temperature for higher accuracy and higher temperature for
                              more varied outputs.  [default: 0.7; x>0]
  --top_k INTEGER RANGE       Limit the number of vocabs to consider.  [default: 20; x>=1]
  --top_p FLOAT RANGE         Limit the set of vocabs by cumulative probability.  [default: 0.8; 0<x<=1]
  -h, --help                  Show this message and exit.

FAQ

There are a lot of similar projects. Why would I use this?

A good commit message should reflect the purpose of the changes made concisely. Most LLMs failed to do that at zero-shot learning. This project aims to generate messages that focus on the "why" instead of "what", by using a fine-tuned model on 300K high-quality Python commits.

Moreover, it only uses local LLM. You code is safe from the internet.

License

git-gen is distributed under the terms of the MIT license.

Notes

Build and push project

python -m pip install --upgrade build
python -m build
python -m pip install --upgrade twine
python -m twine upload --repository pypi dist/* --verbose

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_gen_utils-0.0.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_gen_utils-0.0.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file git_gen_utils-0.0.1.tar.gz.

File metadata

  • Download URL: git_gen_utils-0.0.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for git_gen_utils-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6f458f6a737f41cfafeb702321c47460e379ce5117d9ad84403b9baac04c3b44
MD5 b599b582f4eaed4b2cbacf6d2941a155
BLAKE2b-256 9704480ac85b02fcdb9cfa8ebadc2e39c94d9873b335dc757742b1fe186df10e

See more details on using hashes here.

File details

Details for the file git_gen_utils-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: git_gen_utils-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for git_gen_utils-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d3596b75d644a605e4dff8be40706ca92dab8b521fe571c6f288bac13eb1632
MD5 7421ad1ba51511a6f0d2c60447e65d57
BLAKE2b-256 c9134087e3a8eeb7f41c89c4345499fc850f8761e8999a9247072aea9d0c0a55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page