#dynamically changing the max tokens

15 messages · Page 1 of 1 (latest)

storm oar
#

I’m trying to make the max tokens used in the divinci model change dynamically but it’s not working. I’m using max_tokens = 4096 - len(word_tokenize(prompt)) but it’s giving errors

#

The error is saying I’m trying to request more tokens than I actually am

#

When I print out the length it says less than what the openai error is saying

unkempt basin
storm oar
unkempt basin
safe swan
storm oar
#

i know that but i cant find a way to count the tokens

safe swan
#

I see that you're already doing that calculation, but your word_tokenize function most be wrong if it's not getting the right amount

#

The way to count the tokens is by using the tokenizer. Like I've already said and Perny has already said

#

It may be worth looking into that rust compiler issue that you have

storm oar
#

i cant import that

safe swan
#

because it's going to be difficult to run models locally if you don't have the rust compiler or it's toolchain installed

#

after you fix that, you should be able to install and import it