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 86a1e15 commit edf2e9eCopy full SHA for edf2e9e
tools/AutoTuner/src/autotuner/distributed.py
@@ -290,8 +290,12 @@ def read_tune_ax(name, this):
290
dict_["value_type"] = "float"
291
return dict_
292
293
- with open(file_name) as file:
294
- data = json.load(file)
+ # Check file exists and whether it is a valid JSON file.
+ assert os.path.isfile(file_name), f'File {file_name} not found.'
295
+ try:
296
+ with open(file_name) as file: data = json.load(file)
297
+ except json.JSONDecodeError:
298
+ raise ValueError(f"Invalid JSON file: {file_name}")
299
sdc_file = ''
300
fr_file = ''
301
if args.mode == 'tune' and args.algorithm == 'ax':
0 commit comments