Skip to content

Commit 838a4a9

Browse files
committed
remove task group since it doesn't work with python 3.10
1 parent a4a9399 commit 838a4a9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/forge/actors/generator.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,16 +270,15 @@ def split_keys(keys):
270270
return [keys[i::n_fetchers] for i in range(n_fetchers)]
271271

272272
futures = []
273-
async with asyncio.TaskGroup() as tg:
274-
for i, names in enumerate(split_keys(hf_param_names)):
273+
for i, names in enumerate(split_keys(hf_param_names)):
275274

276-
async def fetch_coro():
277-
return self.weight_fetchers.slice(procs=i).fetch.call_one(
278-
version=version, param_names=names
279-
)
275+
async def fetch_coro():
276+
return self.weight_fetchers.slice(procs=i).fetch.call_one(
277+
version=version, param_names=names
278+
)
280279

281-
fut = tg.create_task(fetch_coro())
282-
futures.append(fut)
280+
fut = asyncio.create_task(fetch_coro())
281+
futures.append(fut)
283282

284283
sub_state_dicts = [await fut for fut in futures]
285284

0 commit comments

Comments
 (0)