How to increase tokens text generation API
I can only get a few tokens back from an API call; so I tried this code, but it didn’t work.  How can I tune the length of the tokens returned?def query(payload):
    data = json.dumps(payload)
    response = requests.request("POST", API_URL, headers=headers, data=data)
    return json.loads(response.content.decode("utf-8"))
data = query(
    {

        "inputs": "Albert Einstein was",
        "parameters": {max_new_tokens = 100}
    }
)
print(data)
2022-08-28T01:10:41Z
Solved it!  It’s just bad python syntax.  Duh!def query(payload):
    data = json.dumps(payload)
    response = requests.request("POST", API_URL, headers=headers, data=data)
    return json.loads(response.content.decode("utf-8"))
data = query(
#    {
#
#        "inputs": "Albert Einstein was",
#       "parameters": { "min_length" : 100,
#             "max_length" : 100 }
#    }
    {

        "inputs": "Albert Einstein was",
        "parameters": { "min_length" : 100,
             "max_new_tokens" : 100 }
    }
)
print(data)
print("Time consumed in working: ",end - start)