From ca6ee9bbced0f653da809670a28ea7c624f95cb5 Mon Sep 17 00:00:00 2001 From: Gustavo Romero Date: Mon, 18 Oct 2021 21:25:26 +0000 Subject: [PATCH 1/2] [microTVM] Arduino: Fix MLF archive filename in generated project dir Currently generate_project API method is copying the input MLF archive filename without renaming it to "model.tar" - hence not in accordance with the specification. As a consequence when the server looks for that file to determine if it's a project dir or a template dir it always determines it is a template dir since "model.tar" can never be found, so a TemplateProjectError() exception is thrown when instantiating a GeneratedProject class. This commit fixes that by correctly copying the input MLF archive to the newly generated project dir as "model.tar" so the server can find it. It also takes the chance to change the MLF path returned by server_info_query method: only if it's not a template dir the MLF path is returned, otherwise an empty string is returned (it doesn't make sense to return a MLF path when it's a template dir because there isn't any model associated to a template dir). Signed-off-by: Gustavo Romero --- apps/microtvm/arduino/template_project/microtvm_api_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/microtvm/arduino/template_project/microtvm_api_server.py b/apps/microtvm/arduino/template_project/microtvm_api_server.py index 3d25d0bcad8f..27248e65cbfb 100644 --- a/apps/microtvm/arduino/template_project/microtvm_api_server.py +++ b/apps/microtvm/arduino/template_project/microtvm_api_server.py @@ -152,7 +152,7 @@ def server_info_query(self, tvm_version): return server.ServerInfo( platform_name="arduino", is_template=IS_TEMPLATE, - model_library_format_path=MODEL_LIBRARY_FORMAT_PATH, + model_library_format_path="" if IS_TEMPLATE else MODEL_LIBRARY_FORMAT_PATH, project_options=PROJECT_OPTIONS, ) @@ -352,7 +352,7 @@ def generate_project(self, model_library_format_path, standalone_crt_dir, projec # Unpack the MLF and copy the relevant files metadata = self._disassemble_mlf(model_library_format_path, source_dir) - shutil.copy2(model_library_format_path, source_dir / "model") + shutil.copy2(model_library_format_path, project_dir / MODEL_LIBRARY_FORMAT_RELPATH) # For AOT, template model.h with metadata to minimize space usage if options["project_type"] == "example_project": From af0f3deebe3ba36a659d36f5b634e06c78d53678 Mon Sep 17 00:00:00 2001 From: Gustavo Romero Date: Wed, 27 Oct 2021 00:29:18 +0000 Subject: [PATCH 2/2] Retrigger CI