From 2796a7da519f20af3a3f210bba3b32ff9f577a38 Mon Sep 17 00:00:00 2001 From: rex <1073853456@qq.com> Date: Wed, 1 Nov 2023 23:29:31 +0800 Subject: [PATCH] use tqdm for linux windows --- chattool/asynctool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chattool/asynctool.py b/chattool/asynctool.py index 41a6293..24ada0a 100644 --- a/chattool/asynctool.py +++ b/chattool/asynctool.py @@ -3,7 +3,7 @@ from typing import List, Dict, Union, Callable from chattool import Chat, Resp, load_chats import chattool -from tqdm.asyncio import tqdm +from tqdm.asyncio import tqdm, tqdm_asyncio async def async_post( session , sem @@ -119,7 +119,8 @@ async def chat_complete(ind, locker, chatlog, chkpoint, **options): if chattool.platform == "macos": responses = await tqdm.gather(tasks) else: # for windows and linux - responses = await asyncio.gather(*tasks) + # responses = await asyncio.gather(*tasks) + responses = tqdm_asyncio.gather(*tasks) for ind, cost in responses: costs[ind] = cost return costs