in src/neo_loader/__init__.py [0:0]
def extract_model_artifacts(archive=None, output_directory='/compiler', sidecar=True) -> [str]:
if not archive:
archive = find_archive()
base_dir = archive[:archive.rfind('/')]
file_list = []
try:
with tarfile.open(archive, 'r:gz') as tf:
tf.extractall(output_directory)
file_list = tf.getnames()
except Exception as e:
logger.error(repr(e))
raise RuntimeError("InputConfiguration: Unable to untar input model. "
"Please confirm the model is a tar.gz file")
result = []
for model_file in __clean_model_files(file_list):
result.append(os.path.join(output_directory, model_file))
logger.info(f"Successfully extracted model artifacts from {archive}")
logger.info(f"files: {result}")
return result