makefile
Browse files
Makefile
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
setup: install preprocess augment
|
| 2 |
+
|
| 3 |
+
setup-runpod: install-runpod preprocess augment
|
| 4 |
+
|
| 5 |
+
install:
|
| 6 |
+
pip3 install --no-cache-dir --break-system-packages -r requirements-cpu.txt
|
| 7 |
+
pip3 install --no-cache-dir --break-system-packages -r requirements.txt
|
| 8 |
+
|
| 9 |
+
install-runpod:
|
| 10 |
+
pip3 install --break-system-packages --ignore-installed blinker -r requirements.txt
|
| 11 |
+
pip3 install --break-system-packages --force-reinstall "torch>=2.6.0" "torchvision>=0.21.0"
|
| 12 |
+
pip3 install --break-system-packages --force-reinstall "numpy<2"
|
| 13 |
+
|
| 14 |
+
install-mac:
|
| 15 |
+
/usr/local/bin/python3 -m pip install --break-system-packages -r requirements.txt
|
| 16 |
+
|
| 17 |
+
preprocess:
|
| 18 |
+
python3 -m src.models.preprocess
|
| 19 |
+
|
| 20 |
+
augment:
|
| 21 |
+
python3 -m src.models.augment --max-length $(or $(MAX_LENGTH),256)
|
| 22 |
+
|
| 23 |
+
serialize:
|
| 24 |
+
python3 -m src.models.serialize --model-dir $(MODEL_DIR)
|
| 25 |
+
|
| 26 |
+
serialize-marker:
|
| 27 |
+
python3 -m src.models.serialize --model-dir models/marker
|
| 28 |
+
|
| 29 |
+
serialize-qa-m:
|
| 30 |
+
python3 -m src.models.serialize --model-dir models/qa_m
|
| 31 |
+
|
| 32 |
+
serialize-qa-b:
|
| 33 |
+
python3 -m src.models.serialize --model-dir models/qa_b
|
| 34 |
+
|
| 35 |
+
serialize-all: serialize-marker serialize-qa-m serialize-qa-b
|
| 36 |
+
|
| 37 |
+
inference:
|
| 38 |
+
python3 -m src.models.inference --model-dir $(MODEL_DIR) --data $(DATA) --output $(OUTPUT)
|
| 39 |
+
|
| 40 |
+
inference-marker:
|
| 41 |
+
python3 -m src.models.inference --model-dir models/marker --data $(DATA) --output predictions_marker.json
|
| 42 |
+
|
| 43 |
+
inference-qa-m:
|
| 44 |
+
python3 -m src.models.inference --model-dir models/qa_m --data $(DATA) --output predictions_qa_m.json
|
| 45 |
+
|
| 46 |
+
inference-qa-b:
|
| 47 |
+
python3 -m src.models.inference --model-dir models/qa_b --data $(DATA) --output predictions_qa_b.json
|
| 48 |
+
|
| 49 |
+
inference-all: inference-marker inference-qa-m inference-qa-b
|
| 50 |
+
|
| 51 |
+
hf-upload:
|
| 52 |
+
python3 -m src.models.hf_upload $(if $(MODE),--mode $(MODE))
|
| 53 |
+
|
| 54 |
+
hf-upload-marker:
|
| 55 |
+
python3 -m src.models.hf_upload --mode marker
|
| 56 |
+
|
| 57 |
+
hf-upload-qa-m:
|
| 58 |
+
python3 -m src.models.hf_upload --mode qa_m
|
| 59 |
+
|
| 60 |
+
hf-upload-qa-b:
|
| 61 |
+
python3 -m src.models.hf_upload --mode qa_b
|
| 62 |
+
|
| 63 |
+
hf-upload-fasttext:
|
| 64 |
+
python3 -m src.models.hf_upload --mode fasttext
|
| 65 |
+
|
| 66 |
+
hf-upload-all: hf-upload-marker hf-upload-qa-m hf-upload-qa-b hf-upload-fasttext
|
| 67 |
+
|
| 68 |
+
hf-download:
|
| 69 |
+
python3 -m src.models.hf_download $(if $(MODE),--mode $(MODE))
|
| 70 |
+
|
| 71 |
+
hf-download-marker:
|
| 72 |
+
python3 -m src.models.hf_download --mode marker
|
| 73 |
+
|
| 74 |
+
hf-download-qa-m:
|
| 75 |
+
python3 -m src.models.hf_download --mode qa_m
|
| 76 |
+
|
| 77 |
+
hf-download-qa-b:
|
| 78 |
+
python3 -m src.models.hf_download --mode qa_b
|
| 79 |
+
|
| 80 |
+
hf-download-fasttext:
|
| 81 |
+
python3 -m src.models.hf_download --mode fasttext
|
| 82 |
+
|
| 83 |
+
hf-download-all: hf-download-marker hf-download-qa-m hf-download-qa-b hf-download-fasttext
|
| 84 |
+
|
| 85 |
+
train-fasttext:
|
| 86 |
+
python3 -m src.models.fasttext
|
| 87 |
+
|
| 88 |
+
start-be:
|
| 89 |
+
uvicorn app:app --host 0.0.0.0 --port 8000 --reload
|
| 90 |
+
|
| 91 |
+
start-fe:
|
| 92 |
+
streamlit run main.py
|
| 93 |
+
|