Skip to main content

A package for converting chat messages to and from ChatML format

Project description

pychatml

The pychatml package allows you to convert chat interfaces from and to the ChatML format.

Installation

You can install the pychatml package using pip:

pip install pychatml

What

Makes it easy to integrate between different chat formats and models.

import pychatml

PROMPT = """[INST Hi, how are you? [/INST] Good thanks! 
[INST] Can you help me with this math program? [/INST]"""

pychatml.llama2.to_chatml(PROMPT)
[
    {"role": "user", "content": "Hi, how are you?"},
    {"role": "assistant", "content": "Good thanks!"},
    {"role": "user", "content": "Can you help me with this math program?"},
]

Supported formats

  • Llama 2
  • Anthropic
  • Alpaca
  • Vicuna/ShareGPT

Why?

Motivation tweet

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

pychatml-0.0.4.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

pychatml-0.0.4-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file pychatml-0.0.4.tar.gz.

File metadata

  • Download URL: pychatml-0.0.4.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for pychatml-0.0.4.tar.gz
Algorithm Hash digest
SHA256 0359a9e3de93cec7aacb2f5825448767f827721c5bb8be1932762482d150d826
MD5 c6806c4e0e6ac43889a9134dea47513a
BLAKE2b-256 2787ee6e5ddb3b0f18b967ef6ce6ce11d2b85aacede5985fd1b0abb9611f6f0a

See more details on using hashes here.

File details

Details for the file pychatml-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pychatml-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for pychatml-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7148ad36eda073dac659531fb1f6b5cc8842d2931ed4f7121f2f5cad826e14e5
MD5 c6f803f00adc74a5775d0e5b56c29f34
BLAKE2b-256 4ffb1d2e415a857d4730a0647da3157112a168581cdd05b5de6df232d22356c5

See more details on using hashes here.

Supported by

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