726b60dc29
- Use build_policy(checkpoint_path) for fp8_scaled_mm - Add .env.example template - Add Makefile with common targets (install, api, docs, clean, lint)
34 lines
1.0 KiB
Makefile
34 lines
1.0 KiB
Makefile
PYTHON := .venv/bin/python
|
|
PIp := .venv/bin/pip
|
|
UVICORN := .venv/bin/uvicorn
|
|
LTX_PKG := libs/LTX-2
|
|
DB := app/jobs.db
|
|
PORT ?= 8000
|
|
RELOAD ?= --reload
|
|
|
|
.PHONY: install lint api clean docs
|
|
|
|
# Install project deps (LTX packages must be installed first manually)
|
|
install:
|
|
$(PIP) install -r requirements.txt
|
|
|
|
# Run the API server
|
|
api:
|
|
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True \
|
|
$(UVICORN) app.main:app --host 0.0.0.0 --port $(PORT) $(RELOAD)
|
|
|
|
# Generate OpenAPI docs as JSON
|
|
docs:
|
|
$(PYTHON) -c "import json; from app.main import app; json.dump(app.openapi(), open('openapi.json', 'w'), indent=2)"
|
|
|
|
# Clean up generated artifacts
|
|
clean:
|
|
rm -rf videos/*.mp4 $(DB) *.db __pycache__ app/__pycache__
|
|
|
|
# Lint
|
|
lint:
|
|
@command -v ruff >/dev/null && .venv/bin/ruff check app/ || echo "ruff not installed"
|
|
@command -v flake8 >/dev/null && .venv/bin/flake8 app/ || echo "flake8 not installed"
|
|
$(PYTHON) -m py_compile app/main.py app/config.py app/models.py app/service.py app/database.py
|
|
@echo "Syntax OK"
|