Getting started
1. 환경 설정
설치 소스코드를 준비합니다.
git clone https://dev.azure.com/SaigeResearch/Research/_git/SaigeMLOps
cd SaigeMLOps
git submodule update --init --recursive
conda 환경을 생성하고 requirements를 설치합니다.
conda create -n research python=3.8 # 연구팀 공통 conda env
conda activate research
pip install -r requirements.txt
2. Python API 테스트
API 테스트를 통해 소스코드와 환경이 제대로 설정 되었는지 확인합니다.
python test/test_cls_api.py # 마지막에 ALL PASSED 출력되면 정상입니다.
3. 라이브러리 빌드 & API 테스트
원하는 경로에 SaigeMLOps Classification 라이브러리를 빌드합니다. 예제에서는 deploy 폴더를 사용합니다.
python setup/setup_cls.py build_ext --build-lib deploy
빌드된 바이너리 라이브러리로 API 테스트를 진행합니다.
python test/test_cls_api.py --module_path ./deploy # 마지막에 ALL PASSED 출력되면 정상입니다.
4. 빌드된 라이브러리 사용
빌드된 바이너리를 import해 필요한 기능을 사용합니다.
from deploy.mlops.classification import MLOpsTrainer
...
각 기능에 대한 설명은 API reference를 참고하세요.
5. 데모
API를 사용해 모델 학습과 인퍼런스를 수행하는 데모 코드입니다.
# 학습 데모
python demo/classification/train.py
# 인퍼런스 데모
python demo/classification/inference.py