This commit is contained in:
Robert Bendun 2023-05-24 00:08:42 +02:00
parent 33d5b279cf
commit b193a9230e
4 changed files with 61 additions and 0 deletions

27
.github/workflows/train.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: train-model
on:
workflow-dispatch:
inputs:
epochs:
description: 'Number of epochs for training'
required: true
default: '1'
jobs:
train:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Docker action
id: train
uses: ./
with:
epochs: 1
- name: Archive
uses: action/upload-artifact@v3
with:
name: model
path: model.keras

5
train-entrypoint.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
cd /ium/src
python3 tf_train.py "$1"
cp /ium/src/model.keras /github/workspace/

17
train.dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM ubuntu:22.04
RUN apt update && apt install -y vim make python3 python3-pip python-is-python3 gcc g++ golang wget unzip git
RUN pip install pandas matplotlib scikit-learn tensorflow
RUN mkdir /ium
COPY . /ium
WORKDIR /ium/src/
RUN wget https://bendun.students.wmi.amu.edu.pl/stop_times.train.tsv
RUN wget https://bendun.students.wmi.amu.edu.pl/stop_times.valid.tsv
RUN wget https://bendun.students.wmi.amu.edu.pl/stop_times.categories.tsv
VOLUME /github/workspace/
ENTRYPOINT ["/ium/train-entrypoint.sh"]

12
train.yml Normal file
View File

@ -0,0 +1,12 @@
name: Train
description: 'Train model'
inputs:
epochs:
description: 'Number of epochs'
required: true
default: '2'
runs:
using: 'docker'
image: 'train.dockerfile'
args:
- ${{ inputs.epochs }}