public static int tokens(String modelName, String text) {
        return encode(modelName, text).size();
    }
Calculate the tokens of a specified string by model name.

@param modelName
@param text
@return Number of tokens
api/src/main/java/com/theokanning/openai/utils/TikTokensUtil.java