Input and output processing for IBM Granite models
Project description
granite-common
Python library that provides enhanced prompt creation and output parsing for IBM Granite models.
Installation
To install from the main development branch, type:
pip install git+https://github.com/ibm-granite/granite-common.git
Developer setup
For compatibility with different underlying operating system versions, we recommend using conda to create a consistent base Python environment for development and testing.
Detailed instructions:
- Install MiniForge or another package that provides the
condacommand-line utility. - Set the environment variable
CONDA_HOMEto point to the root of yourcondainstall. If you installed MiniForge in your home directory, this value should be${HOME}/miniforge3. - Check out a copy of this repository.
- Run the script
scripts/env.shfrom the root of your local copy of the repository. The script will create a Conda environment in./envand will install the source code of your local copy as an editable Pip package. The script will also install and enable pre-commit hooks with pre-commit. - Before running commands such as
pythonorjupyterfrom the command line, activate the Conda environment by typingconda activate ./envfrom the root of your local copy of this repository. - If you are using Visual Studio Code or a similar IDE, configure your IDE to use the environment at
./env
Running tests
After following the instructions in the previous section, you should be able to run tests on your local machine by typing:
pytest tests
from the root of your local copy of this repository, using the conda environment described in the previous section.
The build automation for this project uses the tox environment manager. Sometimes you will need to run tests from inside a tox managed environment to replicate issues from the continuous integration environment. To run tests with tox, activate the Python environment ./env created earlier, then choose from among the following:
- Run regression tests:
tox -e unit - Run
pylintchecks:tox -e lint - Run
ruffformatter:tox -e ruff - Run a full continuous integration suite:
tox
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file granite_common-0.3.6.tar.gz.
File metadata
- Download URL: granite_common-0.3.6.tar.gz
- Upload date:
- Size: 672.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58b2608dc5c71e8a169cc5f8e5fb2faedca035a3c92629ae1e396c8724e28397
|
|
| MD5 |
8c37273e4f096755e4460cec90b89fda
|
|
| BLAKE2b-256 |
206f9278b41402e4d93dc22e4796ab68fa4f0e20ae0718499d6c65f767f1a09e
|
Provenance
The following attestation bundles were made for granite_common-0.3.6.tar.gz:
Publisher:
pypi.yml on ibm-granite/granite-common
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
granite_common-0.3.6.tar.gz -
Subject digest:
58b2608dc5c71e8a169cc5f8e5fb2faedca035a3c92629ae1e396c8724e28397 - Sigstore transparency entry: 762510643
- Sigstore integration time:
-
Permalink:
ibm-granite/granite-common@77f842171c6303baa28261abdfec7cc979833c8e -
Branch / Tag:
refs/tags/v0.3.6 - Owner: https://github.com/ibm-granite
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@77f842171c6303baa28261abdfec7cc979833c8e -
Trigger Event:
release
-
Statement type:
File details
Details for the file granite_common-0.3.6-py3-none-any.whl.
File metadata
- Download URL: granite_common-0.3.6-py3-none-any.whl
- Upload date:
- Size: 84.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd3363b618abce5888f5b2b041f1a875dd8598f739e7cac087bdabd4791af5a2
|
|
| MD5 |
cef6b68ad2052ae9610ebff54a00c3bd
|
|
| BLAKE2b-256 |
10b5376d80040d424533f2d6c1232922672cf52c7bfffd8a2a1503603ede34e8
|
Provenance
The following attestation bundles were made for granite_common-0.3.6-py3-none-any.whl:
Publisher:
pypi.yml on ibm-granite/granite-common
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
granite_common-0.3.6-py3-none-any.whl -
Subject digest:
dd3363b618abce5888f5b2b041f1a875dd8598f739e7cac087bdabd4791af5a2 - Sigstore transparency entry: 762510648
- Sigstore integration time:
-
Permalink:
ibm-granite/granite-common@77f842171c6303baa28261abdfec7cc979833c8e -
Branch / Tag:
refs/tags/v0.3.6 - Owner: https://github.com/ibm-granite
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@77f842171c6303baa28261abdfec7cc979833c8e -
Trigger Event:
release
-
Statement type: