Skip to content

Commit 97cf063

Browse files
committed
fix: parallel_download_decorator compatible with transformers >= 5
1 parent 9fafeb4 commit 97cf063

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

qllm/modeling/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ def cached_file_func_in_thread(task_func, *args, **kwargs):
128128
return executor.submit(task_func, *args, **kwargs)
129129
transformers.utils.hub.cached_file = functools.partial(cached_file_func_in_thread, transformers.utils.hub.cached_file)
130130
result = task_func_shard(*args, **kwargs)
131-
result_0 = [future.result() for future in result[0]]
131+
result_0 = []
132+
for item in result[0]:
133+
if isinstance(item, str):
134+
result_0.append(item)
135+
else:
136+
result_0.append(item.result())
132137
return result_0, result[1]
133138

134139

0 commit comments

Comments
 (0)