utils.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:open-database 作者: mitaffinity 项目源码 文件源码
def load_compatibility(filename):
    """Reconstruct a Python object from a file persisted with joblib.dump.
    This function ensure the compatibility of joblib old persistence format (<= 0.9.3)"""
    file_handle = open(filename, 'rb')
    unpickler = ZipNumpyUnpickler(filename, file_handle=file_handle)
    try:
        obj = unpickler.load()
    finally:
        if hasattr(unpickler, 'file_handle'):
            unpickler.file_handle.close()
    return obj
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号