File size: 387 Bytes
3883c60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import huggingface_hub.file_download as fd


original_check_disk_space = fd._check_disk_space


def _check_disk_space(expected_size, target_dir):
    """Calls the original, but with a try-catch to fix some crashes"""
    try:
        original_check_disk_space(expected_size, target_dir)
    except Exception as _:
        pass


def patch():
    fd._check_disk_space = _check_disk_space