43 lines
1.1 KiB
Makefile
43 lines
1.1 KiB
Makefile
.PHONY: install run-fastapi run-flask test clean help
|
|
|
|
# Default Python interpreter
|
|
PYTHON := python3
|
|
|
|
# Default ports
|
|
FASTAPI_PORT := 8000
|
|
FLASK_PORT := 5000
|
|
|
|
help:
|
|
@echo "XGBoost Multi-Label Classification API"
|
|
@echo ""
|
|
@echo "Usage:"
|
|
@echo " make install Install Python dependencies"
|
|
@echo " make run-fastapi Start FastAPI server (port $(FASTAPI_PORT))"
|
|
@echo " make run-flask Start Flask server (port $(FLASK_PORT))"
|
|
@echo " make test Run the inference example"
|
|
@echo " make clean Clean up cache files"
|
|
@echo ""
|
|
|
|
install:
|
|
$(PYTHON) -m pip install -r requirements.txt
|
|
|
|
run-fastapi:
|
|
$(PYTHON) xgb_fastapi.py --port $(FASTAPI_PORT)
|
|
|
|
run-fastapi-dev:
|
|
$(PYTHON) xgb_fastapi.py --port $(FASTAPI_PORT) --reload
|
|
|
|
run-flask:
|
|
$(PYTHON) xgb_rest_api.py --port $(FLASK_PORT)
|
|
|
|
run-flask-debug:
|
|
$(PYTHON) xgb_rest_api.py --port $(FLASK_PORT) --debug
|
|
|
|
test:
|
|
$(PYTHON) xgb_inference_example.py
|
|
|
|
clean:
|
|
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
|
|
find . -type f -name "*.pyc" -delete 2>/dev/null || true
|
|
find . -type f -name "*.pyo" -delete 2>/dev/null || true
|