תיקון שגיאה בריצת אימון #132
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 NER model | |
on: | |
push: | |
branches: | |
- machine-learn | |
paths: | |
- 'machine-learn/scrape_data/cleaned_new-data.json' | |
- 'machine-learn/model_name.txt' | |
- 'machine-learn/creating_model_git.py' | |
jobs: | |
train-ner-model: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
pip install spacy==3.7.5 pandas tqdm | |
- name: Set working directory | |
run: cd machine-learn/ | |
working-directory: ${{ github.workspace }} | |
- name: Run training script | |
run: | | |
python machine-learn/creating_model_git.py | |
- name: Read model name from file | |
id: model-name | |
run: echo "MODEL_NAME=$(cat /home/runner/work/Singles-Sorter/Singles-Sorter/machine-learn/model_name.txt)" >> $GITHUB_OUTPUT | |
- name: Debug model name | |
run: echo "Model name is ${{ steps.model-name.outputs.MODEL_NAME }}" | |
- name: Move prepared file to internal folder | |
run: | | |
mv ${{ steps.model-name.outputs.MODEL_NAME }} machine-learn/ | |
- name: Move iteration_data.json to model folder | |
run: | | |
mv /home/runner/work/Singles-Sorter/Singles-Sorter/machine-learn/iteration_data.json machine-learn/${{ steps.model-name.outputs.MODEL_NAME }}/ | |
- name: Commit and push changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add machine-learn/${{ steps.model-name.outputs.MODEL_NAME }} | |
git commit -m "Update ${{ steps.model-name.outputs.MODEL_NAME }} including iteration_data.json" || echo "No changes to commit" | |
git push |