Initial commit

This commit is contained in:
Bole Ma
2025-12-10 12:17:41 +01:00
commit 739563f916
12 changed files with 3428 additions and 0 deletions

42
Makefile Normal file
View File

@@ -0,0 +1,42 @@
.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