train model #3066
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: train model | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 5,10 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
architecture: x64 | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
# This path is specific to Ubuntu | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
# - name: train inventory model | |
# run: | | |
# cd inventory && python train_torch_from_collect.py | |
- name: train inventory model | |
uses: nick-fields/retry@v2 | |
with: | |
timeout_minutes: 60 | |
retry_wait_seconds: 3600 | |
max_attempts: 2 | |
command: cd inventory && python train_torch_from_collect.py | |
new_command_on_retry: | | |
git add . && git reset HEAD --hard | |
pwd | |
cd inventory && python train_torch_from_collect.py | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v7 | |
with: | |
author_name: github-actions | |
author_email: 41898282+github-actions[bot]@users.noreply.github.com | |
message: 'auto update by git action' | |
add: '.' |