Skip to content

Commit

Permalink
feat: Pull and use fasttext Docker image (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris authored Sep 27, 2020
1 parent 41db3bb commit 2cdad50
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/suggest-related-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ on:
workflow_dispatch:
schedule:
- cron: '13 13 * * */7'
pull_request:
paths:
- '.github/workflows/suggest-related-links.yml'
- 'models/**'
- '!*.md'

jobs:
action:
Expand All @@ -24,7 +19,7 @@ jobs:
run: echo "${GITHUB_CONTEXT}"

- name: Setup Python
if: github.event_name == 'issues' || github.event_name == 'pull_request'
if: github.event_name == 'issues'
uses: actions/setup-python@v2.1.2
with:
python-version: '3.8'
Expand All @@ -39,26 +34,17 @@ jobs:
- uses: peaceiris/actions-suggest-related-links@v1.0.0

- name: Setup model
if: github.event_name == 'issues' || github.event_name == 'pull_request'
run: |
cd ~
git clone https://github.com/peaceiris/actions-suggest-related-links.git
cd ./actions-suggest-related-links/models
git checkout v1.0.0
python3 -m pip install -r ./requirements.txt
- name: fastText
if: github.event_name == 'issues'
run: |
cd ~/actions-suggest-related-links/models/fasttext
cp ~/actions-suggest-related-links-tmp/training-data.json .
cp ~/actions-suggest-related-links-tmp/input.txt .
python3 train.py -d training-data.json -test input.txt
git clone https://github.com/peaceiris/actions-suggest-related-links.git ~/asrl
cd ~/asrl/models/fasttext
git checkout 41db3bb
cp ~/actions-suggest-related-links-tmp/{training-data.json,input.txt} .
make train
cp ./suggestions.json ~/actions-suggest-related-links-tmp/
- uses: peaceiris/actions-suggest-related-links@v1.0.0
if: github.event_name != 'pull_request'
with:
mode: 'suggest'
repository: 'peaceiris/actions-gh-pages'
Expand Down
4 changes: 4 additions & 0 deletions models/fasttext/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ build:
.PHONY: run
run:
docker-compose run --rm dev bash

.PHONY: train
train:
docker-compose run --rm dev python train.py -d training-data.json -test input.txt
1 change: 0 additions & 1 deletion models/fasttext/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ version: '3'

services:
dev:
build: .
image: docker.pkg.github.com/peaceiris/actions-suggest-related-links/asrl-fasttext:latest
container_name: asrl_fasttext
volumes:
Expand Down

0 comments on commit 2cdad50

Please sign in to comment.