Generation Parameters

These docs are outdated! Please check out https://docs.titanml.co for the latest information on the TitanML platform. If there's anything that's not covered there, please contact us on our discord.

The API supports the standard generation parameters. See below for a description.

To use the parameters include them in the json payload:

import requests

if __name__ == "__main__":
    
    input_text = 'List 3 things to do in London.'

    url = "http://localhost:8000/generate_stream"
    json = {
        "text":input_text,
        "sampling_temperature":0.1,
        "no_repeat_ngram_size":3
        }
     
    response = requests.post(url, json=json, stream=True)
    response.encoding = 'utf-8'
     
    for text in response.iter_content(chunk_size=1, decode_unicode=True):
        if text:
            print(text, end="", flush=True)

Last updated