File size: 1,782 Bytes
eea7ef1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.PHONY: install test lint fmt train deploy pipeline

PYTHON   := python3.12
PIP      := $(PYTHON) -m pip
HF_REPO  ?= LesterCerioli/Speed
MODEL_OUT ?= output

# ── Setup ──────────────────────────────────────────────────────────────────
install:
	$(PIP) install --upgrade pip
	$(PIP) install -r requirements.txt
	$(PIP) install -e ".[dev]"

# ── Quality ────────────────────────────────────────────────────────────────
test:
	pytest tests/ -v --tb=short

lint:
	ruff check src/ tests/
	mypy src/ --ignore-missing-imports

fmt:
	ruff check --fix src/ tests/

# ── Treinamento ────────────────────────────────────────────────────────────
train:
	$(PYTHON) -c "\
from src.models.fiscal_llm import PipelineFiscal; \
p = PipelineFiscal(diretorio_saida='$(MODEL_OUT)'); \
hist = p.treinar(epochs=30, caminho_saida='$(MODEL_OUT)/modelo_fiscal.pt'); \
print(hist)"

# ── Deploy ─────────────────────────────────────────────────────────────────
deploy:
	HF_REPO_ID=$(HF_REPO) MODEL_DIR=$(MODEL_OUT) bash scripts/deploy_huggingface.sh

# ── Pipeline completo ──────────────────────────────────────────────────────
pipeline: install lint test train deploy