From f1eaff3c9790464bed3183ff76555cf815166f50 Mon Sep 17 00:00:00 2001 From: Diego Russo Date: Thu, 2 Feb 2023 22:04:05 +0000 Subject: MLIA-782 Remove --output parameter * Remove --output parameter from argument parser * Remove FormattedFilePath class and its presence across the codebase * Move logging module from cli to core * The output format is now injected in the execution context and used across MLIA * Depending on the output format, TextReporter and JSONReporter have been created and used accordingly. * The whole output to standard output and/or logfile is driven via the logging module: the only case where the print is used is when the --json parameter is specified. This is needed becase all output (including third party application as well) needs to be disabled otherwise it might corrupt the json output in the standard output. * Debug information is logged into the log file and printed to stdout when the output format is plain_text. * Update E2E test and config to cope with the new mechanism of outputting json data to standard output. Change-Id: I4395800b0b1af4d24406a828d780bdeef98cd413 --- src/mlia/backend/tosa_checker/compat.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mlia/backend') diff --git a/src/mlia/backend/tosa_checker/compat.py b/src/mlia/backend/tosa_checker/compat.py index 81f3015..1c410d3 100644 --- a/src/mlia/backend/tosa_checker/compat.py +++ b/src/mlia/backend/tosa_checker/compat.py @@ -5,12 +5,12 @@ from __future__ import annotations import sys from dataclasses import dataclass +from pathlib import Path from typing import Any from typing import cast from typing import Protocol from mlia.backend.errors import BackendUnavailableError -from mlia.core.typing import PathOrFileLike from mlia.utils.logging import capture_raw_output @@ -45,7 +45,7 @@ class TOSACompatibilityInfo: def get_tosa_compatibility_info( - tflite_model_path: PathOrFileLike, + tflite_model_path: str | Path, ) -> TOSACompatibilityInfo: """Return list of the operators.""" # Capture the possible exception in running get_tosa_checker @@ -100,7 +100,7 @@ def get_tosa_compatibility_info( ) -def get_tosa_checker(tflite_model_path: PathOrFileLike) -> TOSAChecker | None: +def get_tosa_checker(tflite_model_path: str | Path) -> TOSAChecker | None: """Return instance of the TOSA checker.""" try: import tosa_checker as tc # pylint: disable=import-outside-toplevel -- cgit v1.2.1