Skip to content

Commit

Permalink
Merge pull request #846 from marrlab/save-initial-model
Browse files Browse the repository at this point in the history
Saving initial model
  • Loading branch information
smilesun authored Jul 25, 2024
2 parents a5f0f07 + c9242cd commit 1520907
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: test if api works
run: poetry run python examples/api/jigen_dann_transformer.py
- name: Generate coverage report
run: rm -r zoutput && poetry run pytest --cov=domainlab tests/ --cov-report=xml
run: rm -rf zoutput && poetry run pytest --cov=domainlab tests/ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand All @@ -42,7 +42,7 @@ jobs:
env:
CODECOV_TOKEN: 02ecb3ac-b7ce-4ea4-90a2-961c3d1a1030
- name: check if readme yaml works
run: rm -r zoutput && python main_out.py -c ./examples/conf/vlcs_diva_mldg_dial.yaml
run: rm -rf zoutput && python main_out.py -c ./examples/conf/vlcs_diva_mldg_dial.yaml
- name: test if examples in markdown works
run: bash -x -v scripts/ci_run_examples.sh
- name: test if benchmark works
Expand Down
3 changes: 2 additions & 1 deletion domainlab/exp/exp_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ def __init__(self, args, task=None, model=None, observer=None, visitor=AggWriter
# visitor must be initialized last after trainer is initialized
self.experiment_duration = None
self.model.set_saver(self.visitor)

def execute(self, num_epochs=None):
"""
train model
check performance by loading persisted model
"""
self.model.save() # cause CI infinite loop when put in initializer?
if num_epochs is None:
num_epochs = self.epochs + 1
t_0 = datetime.datetime.now()
Expand Down

0 comments on commit 1520907

Please sign in to comment.