Skip to content

Add save and load #1794

Add save and load

Add save and load #1794

Workflow file for this run

name: macOS Unit test and code coverage
on:
push:
paths-ignore:
- '**.md'
- 'docs/**'
# - '**.yml'
pull_request:
branches:
- dev
paths-ignore:
- '**.md'
- '**.yml'
- 'docs/**'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, self-hosted]
python-version: [3.8]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
auto-activate-base: false
auto-update-conda: true
if: matrix.os == 'macos-latest'
# - name: Install mac m1
# run: |
# mkdir -p ~/miniconda3
# wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-MacOSX-arm64.sh
# chmod +x Miniconda3-py38_4.12.0-MacOSX-arm64.sh
# bash Miniconda3-py38_4.12.0-MacOSX-arm64.sh -b -u -p ~/miniconda3
# ~/miniconda3/bin/conda init bash
# ~/miniconda3/bin/conda init zsh
# if: matrix.os == 'self-hosted'
- name: Test PyThaiNLP - M1
shell: bash -l {0}
run: |
source ~/miniconda3/etc/profile.d/conda.sh
conda create -y -n pythainlpwork38 python=3.8
conda activate pythainlpwork38
conda info
conda list
python -m pip install --upgrade pip
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True pip install -r docker_requirements.txt
conda install -y -c conda-forge protobuf
pip install pytest coverage coveralls typing_extensions==4.5.0
pip install ssg epitran
pip install fastai==1.0.61
pip install fairseq==0.10.2
conda install -y -c conda-forge icu
conda install -y -c conda-forge pyicu
pip install deepcut tltk
pip install .[full]
python -m nltk.downloader omw-1.4
python -m pip cache purge
python -m unittest discover
if: matrix.os == 'self-hosted'
- shell: bash -l {0}
run: |
conda info
conda list
if: matrix.os == 'self-hosted'
- name: Install PyTorch
shell: bash -l {0}
run: |
pip install torch==1.10.0
if: matrix.os != 'self-hosted'
- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
pip install pytest coverage coveralls
conda install -c conda-forge icu
conda install -c conda-forge pyicu
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True pip install -r docker_requirements.txt
pip install deepcut tltk
pip install .[full]
python -m nltk.downloader omw-1.4
python -m pip cache purge
if: matrix.os != 'self-hosted'
- name: Test
shell: bash -l {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
coverage run -m unittest discover
coveralls
if: matrix.os != 'self-hosted'