Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
MaryaSharf committed Sep 29, 2023
1 parent 409c3af commit 60e7deb
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def run_cmake_and_ninja(cmake_command, build_dir):
subprocess.run(["ninja", "-C", build_dir], check=True)
except subprocess.CalledProcessError as e:
print(f"Error executing command: {e}", file=sys.stderr)
sys.exit(1)

# Build portBLAS
def build_portBLAS():
Expand Down Expand Up @@ -108,8 +109,10 @@ def download_and_convert_model(dir, file_url, destination_file, h5_to_bin_script
os.chdir("..") # Move up one level to the parent directory
except requests.exceptions.RequestException as e:
print(f"Error downloading file: {e}", file=sys.stderr)
sys.exit(1)
except subprocess.CalledProcessError as e:
print(f"Error running h5toBin.py: {e}", file=sys.stderr)
sys.exit(1)


def prepare_image(img_script_path, input_image):
Expand All @@ -118,6 +121,7 @@ def prepare_image(img_script_path, input_image):
print(f"Image prepared successfully.")
except subprocess.CalledProcessError as e:
print(f"Error executing the script: {e}", file=sys.stderr)
sys.exit(1)

# Test on images
def test_image(model_script, data_dir, output_file):
Expand All @@ -131,6 +135,7 @@ def test_image(model_script, data_dir, output_file):
print(f"Image tested successfully with {os.path.basename(model_script)}.")
except subprocess.CalledProcessError as e:
print(f"Error executing the command: {e}", file=sys.stderr)
sys.exit(1)


def main():
Expand Down

0 comments on commit 60e7deb

Please sign in to comment.