File tree 1 file changed +4
-5
lines changed 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 3
3
import sys
4
4
import argparse
5
5
import torch
6
+ import json
6
7
import importlib
7
8
import subprocess
8
9
import torch ._dynamo
15
16
stable_version = os .getenv ("MATRIX_STABLE_VERSION" )
16
17
package_type = os .getenv ("MATRIX_PACKAGE_TYPE" )
17
18
target_os = os .getenv ("TARGET_OS" )
19
+ BASE_DIR = Path (__file__ ).parent .parent
18
20
19
21
is_cuda_system = gpu_arch_type == "cuda"
20
22
NIGHTLY_ALLOWED_DELTA = 3
@@ -54,11 +56,8 @@ def forward(self, x):
54
56
55
57
def load_json_from_basedir (filename : str ):
56
58
try :
57
- if os .path .exists (BASE_DIR / filename ):
58
- with open (BASE_DIR / filename ) as fptr :
59
- return json .load (fptr )
60
- else :
61
- return None
59
+ with open (BASE_DIR / filename ) as fptr :
60
+ return json .load (fptr )
62
61
except FileNotFoundError as exc :
63
62
raise ImportError (f"File { filename } not found error: { exc .strerror } " ) from exc
64
63
except json .JSONDecodeError as exc :
You can’t perform that action at this time.
0 commit comments