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?
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)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0359a9e3de93cec7aacb2f5825448767f827721c5bb8be1932762482d150d826 |
|
MD5 | c6806c4e0e6ac43889a9134dea47513a |
|
BLAKE2b-256 | 2787ee6e5ddb3b0f18b967ef6ce6ce11d2b85aacede5985fd1b0abb9611f6f0a |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7148ad36eda073dac659531fb1f6b5cc8842d2931ed4f7121f2f5cad826e14e5 |
|
MD5 | c6f803f00adc74a5775d0e5b56c29f34 |
|
BLAKE2b-256 | 4ffb1d2e415a857d4730a0647da3157112a168581cdd05b5de6df232d22356c5 |