We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee45615 commit f47adc6Copy full SHA for f47adc6
onnx/export/tar.bz2.py
@@ -7,15 +7,12 @@
7
8
9
def txz(folder_path, output_path):
10
- # 创建.tar文件流
11
- tar_stream = bz2.BZ2File(output_path, 'w')
+ stream = bz2.BZ2File(output_path, 'w')
12
13
- # 将文件夹压缩为.tar文件流
14
- with tarfile.TarFile(fileobj=tar_stream, mode='w') as tar:
15
- tar.add(folder_path, arcname='')
+ with tarfile.TarFile(fileobj=stream, mode='w') as tar:
+ tar.add(folder_path, arcname='')
16
17
- # 关闭.tar文件流
18
- tar_stream.close()
+ stream.close()
19
20
21
txz(ONNX_DIR, ONNX_DIR + '.tar.bz2')
0 commit comments