Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synthetic_transformers-0.3.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

synthetic_transformers-0.3.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file synthetic_transformers-0.3.1.tar.gz.

File metadata

  • Download URL: synthetic_transformers-0.3.1.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

Hashes for synthetic_transformers-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e7c1d3c9bd9eb3a5100efaf074584213194c59a01434df6b1cd0879b5f590c90
MD5 8c6a14f17f5e0c58a0472e49574d0b16
BLAKE2b-256 303f1420fde8d5534a16d9b31fbf196de705301c1adc1dbdfd1f16c99c78d70c

See more details on using hashes here.

File details

Details for the file synthetic_transformers-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for synthetic_transformers-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b83eb018d1b8477cc66d36d8061fee9e1ebc4bc75145667ab5b6e169a34e0dde
MD5 7561219b3acc3c0fc0eeb842683f8612
BLAKE2b-256 8ed27d124bb0ebddb3f05b05a83d8e9476975e8719989d7c6244024897d45ba9

See more details on using hashes here.

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