Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ def __init__(self, templates_dir: str = "./templates", dist_dir: str = "./dist")
def render_templates(self, template_name: str, config: dict):
"""Renders all the templates files from template folder for the given config."""
self.rendered_code[template_name] = {} # clean up the rendered code for given template
# loading the template files based on given template
# loading the template files based on given template and from the _base folder
# since we are using some templates from _base folder
loader = FileSystemLoader([self.templates_dir / "_base", self.templates_dir / template_name])
env = Environment(
loader=FileSystemLoader(self.templates_dir / template_name),
loader=loader,
trim_blocks=True,
lstrip_blocks=True,
)
Expand Down
19 changes: 19 additions & 0 deletions templates/_base/_handlers.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from ignite.contrib.engines import common
{% if setup_common_training_handlers %}
common.setup_common_training_handlers(
trainer=trainer,
train_sampler=None,
to_save=to_save,
output_path='{{ output_path }}',
save_every_iters={{ save_every_iters }},
n_saved={{ n_saved }},
log_every_iters={{ log_every_iters }},
with_pbars={{ with_pbars }},
with_pbar_on_iters={{ with_pbar_on_iters }},
stop_on_nan={{ stop_on_nan }},
clear_cuda_cache={{ clear_cuda_cache }},
lr_scheduler=None,
with_gpu_stats=False,
output_names=None,
)
{% endif %}
21 changes: 0 additions & 21 deletions templates/_base/datasets.py.jinja

This file was deleted.

66 changes: 0 additions & 66 deletions templates/_base/fn.py.jinja

This file was deleted.

139 changes: 0 additions & 139 deletions templates/_base/main.py.jinja

This file was deleted.

8 changes: 0 additions & 8 deletions templates/_base/models.py.jinja

This file was deleted.

Loading