File size: 880 Bytes
af9cd74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
984fc95
af9cd74
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
.PHONY: help install dev run clean test deploy

help: ## 顯示可用指令
	@echo "可用指令:"
	@grep -E '^[a-zA-Z_-]+:.*?## .*$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-12s\033[0m %s\n", $1, $2}'

install: ## 安裝生產依賴
	uv add fastapi
	uv add "uvicorn[standard]"

dev: ## 安裝開發依賴
	uv add --dev huggingface_hub

setup: install dev ## 完整環境設置
	uv export --no-dev > requirements.txt

run: ## 本地運行開發伺服器
	uvicorn app:app --reload --host 0.0.0.0 --port 8000

clean: ## 清理快取檔案
	find . -type d -name __pycache__ -delete
	find . -type f -name "*.pyc" -delete

hf-login: ## 登入 Hugging Face
	huggingface-cli login

deploy: ## 部署到 Hugging Face Spaces
	git add .
	git commit -m "Update application"
	git push

req: ## 更新 requirements.txt
	uv export --no-dev > requirements.txt