diff --git a/bot/bot.py b/bot/bot.py index 2e0f28a..034e9a8 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -94,7 +94,7 @@ async def register_user_if_not_exists(update: Update, context: CallbackContext, # back compatibility for n_used_tokens field n_used_tokens = db.get_user_attribute(user.id, "n_used_tokens") - if isinstance(n_used_tokens, int): # old format + if isinstance(n_used_tokens, int) or isinstance(n_used_tokens, float): # old format new_n_used_tokens = { "gpt-3.5-turbo": { "n_input_tokens": 0, @@ -705,4 +705,4 @@ def run_bot() -> None: if __name__ == "__main__": - run_bot() \ No newline at end of file + run_bot()