Spaces:
Runtime error
Runtime error
# -*- coding: utf-8 -*- | |
# file: test.py | |
# time: 23:21 2023/1/27 | |
# author: yangheng <[email protected]> | |
# github: https://github.com/yangheng95 | |
# huggingface: https://huggingface.co/yangheng | |
# google scholar: https://scholar.google.com/citations?user=NPq5a_0AAAAJ&hl=en | |
# Copyright (C) 2021. All Rights Reserved. | |
def fixBadZipfile(zipFile): | |
f = open(zipFile, 'r+b') | |
data = f.read() | |
pos = data.find('\x50\x4b\x05\x06') # End of central directory signature | |
if (pos > 0): | |
f.seek(pos + 22) # size of 'ZIP end of central directory record' | |
f.truncate() | |
f.close() | |
else: | |
pass | |
if __name__ == '__main__': | |
fixBadZipfile('RealESRGANv030/weights/RealESRGAN_x4plus_anime_6B.zip') |