transformers library new generate API
Project description
synthetic-transformers
Package structure
SyntheticTransformer
Class that will substitute the HuggingFace's PreTrainedModel API. The idea is to use one HuggingFace Transformer and a Tokenizer to initialize this class together with a prompt template and some special plugins as Hooks, Components and Commands. This will create an instance that then you can call as usual with the usual .generate() method.
The idea of this plugins is to give you more control over the generation and allow the LLM to interact with tools in a more dynamic manner.
Hooks
Hooks are one of the two main ways to change how your LLM generates text, they can be triggered by many events and will have access to needed information, such as generated text and others, depending on the activation. There are the following hook types:
on-token: this hook runs when a token is generated by the model, it has access to the generated text and can modify it freely.on-eos: this hook runs when the end of generation exception has been raised.
Commands
Commands are executable functions that can be called during generation.
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 synthetic_transformers-0.3.0.tar.gz.
File metadata
- Download URL: synthetic_transformers-0.3.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.13.1 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bf7dcd99a00e3b6efe14623a3f44e8eb2e93ced448d9f855d94c630aa07e5c7
|
|
| MD5 |
ce6fd6e1e0b259439f1afbb43e1820e1
|
|
| BLAKE2b-256 |
f52dd4472145ea6696504fa1e949d73f7f841798630d397a89c346b60f2760f6
|
File details
Details for the file synthetic_transformers-0.3.0-py3-none-any.whl.
File metadata
- Download URL: synthetic_transformers-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.13.1 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a17580cf132d36542879b350e9d96502541d1ea4f8a7e69554128ebf54eb1d6
|
|
| MD5 |
0939840cc4a144018d0544d0340fb272
|
|
| BLAKE2b-256 |
7929dbc652dadec8ab9d8bccbe0264ce79e471c571c55faf329c769356448e97
|