Skip to content

Commit

Permalink
fix argument of type 'float' is not iterable (#211)
Browse files Browse the repository at this point in the history
* fix argument of type 'float' is not iterable

fix "argument of type 'float' is not iterable" in show_balance_handle and message_handle

* Update bot.py
  • Loading branch information
TanNhatCMS committed Jun 20, 2023
1 parent e42798c commit 8df5e2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -705,4 +705,4 @@ def run_bot() -> None:


if __name__ == "__main__":
run_bot()
run_bot()

0 comments on commit 8df5e2d

Please sign in to comment.