Skip to content

Instantly share code, notes, and snippets.

@piercelamb
Created December 20, 2022 17:51
Show Gist options
  • Save piercelamb/3b7f86ad433c339f3ffd5383e4f25687 to your computer and use it in GitHub Desktop.
Save piercelamb/3b7f86ad433c339f3ffd5383e4f25687 to your computer and use it in GitHub Desktop.
id2label
print(f"Running inference on {config.s3_parent_dir}/run_{config.run_num}")
data_parent_path = f"{config.s3_parent_dir}/data/prepared_data/{config.encoded_data_dir}"
id2label_local_path = os.path.join(os.getcwd(), 'id2label.json')
if not os.path.isfile(id2label_local_path):
id2label_s3_path = f"{data_parent_path}/id2label.json"
bucket.download_file(id2label_s3_path, id2label_local_path)
with open(id2label_local_path) as f:
id2label = json.load(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment