Banana

Free GPT-J Python API

Use a production ready GPTJ model in less than 1 minute. For free!

Deprecation Note:

This free API has been deprecated after SDK version 3.0.1, and will not return if you call it from a more recent version.

To install a compatible SDK version, run:
pip3 install banana-dev==3.0.1

We keep this API live to support the builders who have been using it, but cannot promise constant uptime or maintenance, as we've shifted our engineering focus to our Serverless GPUs platform.


Add this to your python code:

import banana_dev as banana

api_key={your key here}
model_key="gptj"
model_inputs = { "text": "Hey GPTJ! How are you?", "length": 50, "temperature": 0.9, "topK": 50, "topP": 0.9}

out = banana.run(api_key, model_key, model_inputs)
print(out)

Arguments:

Arg Description Required Type Example
api_key Your API key, found on the User Dashboard True string "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
model_key This models name True string "gptj"
model_parameters Dictionary of custom tuning parameters False dict { "text": "Hey GPTJ! How are you?", "length": 50, "temperature": 0.9, "topK": 50, "topP": 0.9}

Fine-Tuning:

Adjusting these parameters from the default is not recommended.

Arg Description Required Type Example
text The input text to prompt generation True string Hey GPTJ! How are you?
temperature A value between 0.1 and 1, to adjust randomness.

- Smaller values create seemingly random output.
- Larger values create repeating phrases in the output.
False (default=0.8) float 0.8
length How many tokens to generate. False (default=50)) int 250
topP A value between 0.1 and 1, to adjust randomness.

- Smaller values create seemingly random output.
- Larger values create repeating phrases in the output.
False (default=0.8) float 0.8
topK an integer >=1. Top k sampling means sorts potential output generations by probability and returns only the topK likely outputs, the rest are zero'd out. False float 50

How to setup and use the free GPT-J API

In this tutorial you'll learn how to set up and use the free GPT-J API hosted by Banana.dev. It is completely free to use this GPT-J API and there are no usage limits for you to build with it.