Skip to main content

A package to easily make an LLM talk with itself for eternity.

Project description

The End is Never

A package to make an LLM talk with itself for eternity.

from thendisnever.thend import isnever
isnever()

is_never() parameters

  • model_name: The model to generate text with.
    • This is the default model.
    • This must be a model compatible with AutoModelForCausalLM (see here for a list of compatible models).
  • prompt: The initial prompt for the model.
    • This is the inspiration for the default prompt.
    • The length in tokens of the prompt must be less than the model's max_length (see here for more info).
  • max_memory_ratio: The % of past tokens to remember.
    • This must be a real number between 0 and 1, since empty prompts are not allowed (0) and the prompt must be smaller than the model's context window for generation to work (1).
  • **kwargs: Parameters for the model.generate() function.
    • See here for information on what parameters are available.

Notes

  • When running isnever() for the first time, it will download the model and tokenizer from HuggingFace. This will take a while, but it only needs to be done once.
  • If you want to use the CPU (not recommended because it's slow, but it works), make sure you have PyTorch for CPU installed.

Contributing

  1. Install poetry if necessary.

  2. Create and setup the poetry environment:

    git clone https://github.com/andrewhinh/thendisnever.git
    cd thendisnever
    poetry shell
    poetry install
    
  3. Make your changes, remembering to update in pyproject.toml the version in the tool.poetry section and the tool.poetry.dependencies section as necessary.

  4. Build the package:

    poetry build
    
  5. Test the package in a fresh environment:

    pip install dist/thendisnever-<version>.tar.gz
    
  6. Once confirmed to work, make a PR from a feature branch to main on GitHub.

  7. Once PR is merged, email me to be added as a collaborator on PyPI.

  8. Once added as a collaborator, publish the package to PyPI:

    poetry config pypi-token.pypi <your-token> # Get your token from https://pypi.org/manage/account/token/
    poetry publish
    

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

thendisnever-0.6.0.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

thendisnever-0.6.0-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

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