Skip to main content

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:

  1. Install MiniForge or another package that provides the conda command-line utility.
  2. Set the environment variable CONDA_HOME to point to the root of your conda install. If you installed MiniForge in your home directory, this value should be ${HOME}/miniforge3.
  3. Check out a copy of this repository.
  4. Run the script scripts/env.sh from the root of your local copy of the repository. The script will create a Conda environment in ./env and 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.
  5. Before running commands such as python or jupyter from the command line, activate the Conda environment by typing conda activate ./env from the root of your local copy of this repository.
  6. 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 pylint checks: tox -e lint
  • Run ruff formatter: tox -e ruff
  • Run a full continuous integration suite: tox

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

granite_common-0.3.5.tar.gz (273.7 kB view details)

Uploaded Source

Built Distribution

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

granite_common-0.3.5-py3-none-any.whl (77.6 kB view details)

Uploaded Python 3

File details

Details for the file granite_common-0.3.5.tar.gz.

File metadata

  • Download URL: granite_common-0.3.5.tar.gz
  • Upload date:
  • Size: 273.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for granite_common-0.3.5.tar.gz
Algorithm Hash digest
SHA256 80d4251b9294b6ec234d5aa4e273801b66f7cc4c5bc77151e5c22e7d7f5a19cd
MD5 25e134bfd7b5ab83f5634cd7cd5deb35
BLAKE2b-256 4db8cba7a2399079838f793cc138c5b341df965c82e7cdaaf4c37deeffa0a14c

See more details on using hashes here.

Provenance

The following attestation bundles were made for granite_common-0.3.5.tar.gz:

Publisher: pypi.yml on ibm-granite/granite-common

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file granite_common-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: granite_common-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 77.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for granite_common-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 fca8fdb7caff7f5714bfda9c81438f4a6df974e0b01631421cd6ca1a19bbb07e
MD5 23c419d4d2744d1d5639b6095c2c66ef
BLAKE2b-256 4cf479d121e4192cf7871122995f060f891c6dbcb91b9b4753e4dd27852704c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for granite_common-0.3.5-py3-none-any.whl:

Publisher: pypi.yml on ibm-granite/granite-common

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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