Skip to main content

No project description provided

Project description

Turbo Text Transformer

Turbo Text Transformer is a Python command-line tool for generating text using OpenAI's GPT-3 and other models. It includes a modular model system that allows for easy integration of new models and customization of existing ones.

Best used in combination with the Turbo Text Transformer Prompts repository!

Configuration

Configs are in the .config folder, put your api key in there

api_key: sk-<your api key here>
engine_params:
  frequency_penalty: 0
  logprobs: null
  max_tokens: 1000
  model: davinci
  n: 4
  presence_penalty: 0
  stop: null
  temperature: 0.9
  top_p: 1
models:
- babbage
- davinci
- gpt-3.5-turbo-0301
- text-davinci-003
etc.

Installation

To install Turbo Text Transformer, you can use pip:

pip install turbo-text-transformer

or clone the repository and install it manually:

git clone https://github.com/fergusfettes/turbo-text-transformer.git
cd turbo-text-transformer
poetry install

Usage

You can use Turbo Text Transformer by running the ttt command in your terminal:

ttt --model davinci --prompt "Hello, GPT-3!"

The above example will generate text using the davinci model and the prompt "Hello, GPT-3!".

Options

There are several options you can use with the ttt command:

  • --model or -m: The name of the model to use. Default is "davinci".
  • --prompt or -p: The prompt to use for text generation.
  • --list_models or -l: List available models.
  • --echo_prompt, -e: Whether to echo the prompt in the output.
  • --format, -f FORMAT: The format of the output. Can be "clean", "json", or "logprobs". Defaults to "clean".
  • --number, -n NUMBER: The number of completions to generate. Defaults to 1.
  • --logprobs, -L LOGPROBS: Whether to show logprobs for each completion. Defaults to False.
  • --max_tokens, -M MAX_TOKENS: The maximum number of tokens to return. Defaults to None.

Configuration

Before using Turbo Text Transformer, you need to set up a configuration file. This should happen automatically when you run the ttt command for the first time: This will create a configuration file in your home directory. You'll also be prompted to enter API keys for the transformer models you want to use. See the documentation for each model to learn how to obtain an API key.

Examples

Here are some examples of how to use Turbo Text Transformer:

# Generate text with the default model
ttt -p "Once upon a time, there was a"

# Generate text with a specific model
ttt -m gpt-2-medium "The meaning of life is"

# Generate multiple completions
ttt -n 5 "I like to eat"

# Show logprobs
ttt -L 1 "I like to eat"

# Use the JSON format
ttt -f json "I like to eat"

You can also tell it to output a formatted json file with the -f json flag. This is useful for piping into other programs.

ttt -f json "The cat sat on the"

and you can pipe txt in-- for example, I generated this readme with the following command:

cat pyproject.toml ttt/__main__.py | tttp -f readme | ttt -m gpt-3.5-turbo -f clear > README.md

If you want to input more text freely, just use it without a prompt and you can write or paste directly into stdin.

Models

Turbo Text Transformer includes support for text generation with all the openai models. Have a look at the model list with ttt -l.

Contributing

If you find a bug or would like to contribute to Turbo Text Transformer, please create a new GitHub issue or pull request.

License

Turbo Text Transformer is released under the MIT License. See LICENSE for more information.

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

turbo_text_transformer-0.1.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

turbo_text_transformer-0.1.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file turbo_text_transformer-0.1.1.tar.gz.

File metadata

  • Download URL: turbo_text_transformer-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-60-generic

File hashes

Hashes for turbo_text_transformer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b6bdd1b9bdcf2d7f3284a2720a4bcead2cafc06e98ba0d7d57527afccaf83b37
MD5 d980bb81436fd3884b7dde4064e7016d
BLAKE2b-256 bfd09d7f814a36bd0baf68baef0753d762294ef822c7154b0833c8d57bc88005

See more details on using hashes here.

File details

Details for the file turbo_text_transformer-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for turbo_text_transformer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 effd4f38c47caf5bfd5b54a320294a339f08a3f4a769af942651797e543c830a
MD5 bf762ed887256ad7594b9c3b47b85edf
BLAKE2b-256 1691c73fb242a010efd26293a874b4b69677ef93237194af1c02370ffe426e00

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