generated from codingpot/newsletter_awesome_articles
-
Notifications
You must be signed in to change notification settings - Fork 14
97 lines (83 loc) · 3.29 KB
/
translation(ko).yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: translation-ko
on:
workflow_run:
workflows: ["mov_to_gif"]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check how many
id: number_check
run: |
echo "::set-output name=number::$(ls ./current/*.yaml | wc -l)"
- name: Set up Python
if: steps.number_check.outputs.number > 0
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up dependencies
if: steps.number_check.outputs.number > 0
working-directory: py
run : |
pip install -r requirements.txt
- name: Set SSH file permissions for monitoring dstack instances
if: steps.number_check.outputs.number > 0
working-directory: py
run: |
mkdir -p ~/.ssh
touch ~/.ssh/config
chmod 700 ~/.ssh
chmod 600 ~/.ssh/config
- name: Set parameters
id: parameters
if: steps.number_check.outputs.number > 0
run: |
echo "::set-output name=yaml_dir::'current'"
echo "::set-output name=output_filename::arxiv_ids.txt"
echo "::set-output name=translated_filename::'paper.ko.html'"
- name: Run arxiv ids extractions from yamls
if: steps.number_check.outputs.number > 0
run : |
python py/arxiv_ids_extractor.py \
--yaml-dir ${{ steps.parameters.outputs.yaml_dir }} \
--output-file ${{ steps.parameters.outputs.output_filename }}
- name: Check File Existence
if: steps.number_check.outputs.number > 0
id: check_file
run: |
if [ -f ${{ steps.parameters.outputs.output_filename }} ]; then
echo "::set-output name=arxiv_ids_file_exist::true"
else
echo "::set-output name=arxiv_ids_file_exist::false"
fi
- name: Run translation jobs
if: steps.number_check.outputs.number > 0 && steps.check_file.outputs.arxiv_ids_file_exist == 'true'
run: |
python py/provision_translation_instance.py \
--dstack-token="${{ secrets.DSTACK_TOKEN }}" \
--github-token="${{ secrets.GH_TOKEN }}" \
--hf-token="${{ secrets.HF_TOKEN }}" \
--model-name="${{ secrets.MODEL_NAME }}" \
--target-archive-github-repo="deep-diver/hf-daily-paper-newsletter" \
--arxiv-ids $(cat ${{ steps.parameters.outputs.output_filename }}) \
--num-of-workers 4
- name: Reflect changes
if: steps.number_check.outputs.number > 0 && steps.check_file.outputs.arxiv_ids_file_exist == 'true'
run: |
git config --global user.name 'Chansung'
git config --global user.email '[email protected]'
git pull
- name: Update YAMLs
if: steps.number_check.outputs.number > 0 && steps.check_file.outputs.arxiv_ids_file_exist == 'true'
run: |
python py/update_yaml.py \
--translated-output-github-repo "deep-diver/hf-daily-paper-newsletter"
- name: Commit Changes
if: steps.number_check.outputs.number > 0 && steps.check_file.outputs.arxiv_ids_file_exist == 'true'
run: |
git add .
git commit -m "Automated report"
git push