Skip to content

Commit f47adc6

Browse files
committed
1 parent ee45615 commit f47adc6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

onnx/export/tar.bz2.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77

88

99
def txz(folder_path, output_path):
10-
# 创建.tar文件流
11-
tar_stream = bz2.BZ2File(output_path, 'w')
10+
stream = bz2.BZ2File(output_path, 'w')
1211

13-
# 将文件夹压缩为.tar文件流
14-
with tarfile.TarFile(fileobj=tar_stream, mode='w') as tar:
15-
tar.add(folder_path, arcname='')
12+
with tarfile.TarFile(fileobj=stream, mode='w') as tar:
13+
tar.add(folder_path, arcname='')
1614

17-
# 关闭.tar文件流
18-
tar_stream.close()
15+
stream.close()
1916

2017

2118
txz(ONNX_DIR, ONNX_DIR + '.tar.bz2')

0 commit comments

Comments
 (0)