fongci commited on
Commit
af9cd74
·
1 Parent(s): d556ae4

Update application

Browse files
Files changed (5) hide show
  1. .gitignore +20 -0
  2. .python-version +1 -0
  3. Makefile +33 -0
  4. main.py +6 -0
  5. pyproject.toml +9 -0
.gitignore ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # uv
2
+ .venv/
3
+ uv.lock
4
+ __pycache__/
5
+ *.py[cod]
6
+ *$py.class
7
+
8
+ # IDE
9
+ .vscode/
10
+ .idea/
11
+ *.swp
12
+ *.swo
13
+
14
+ # OS
15
+ .DS_Store
16
+ Thumbs.db
17
+
18
+ # Hugging Face
19
+ .huggingface/
20
+
.python-version ADDED
@@ -0,0 +1 @@
 
 
1
+ 3.12
Makefile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .PHONY: help install dev run clean test deploy
2
+
3
+ help: ## 顯示可用指令
4
+ @echo "可用指令:"
5
+ @grep -E '^[a-zA-Z_-]+:.*?## .*$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-12s\033[0m %s\n", $1, $2}'
6
+
7
+ install: ## 安裝生產依賴
8
+ uv add fastapi
9
+ uv add "uvicorn[standard]"
10
+
11
+ dev: ## 安裝開發依賴
12
+ uv add --dev huggingface_hub
13
+
14
+ setup: install dev ## 完整環境設置
15
+ uv export --no-dev > requirements.txt
16
+
17
+ run: ## 本地運行開發伺服器
18
+ uvicorn app:app --reload --host 0.0.0.0 --port 8000
19
+
20
+ clean: ## 清理快取檔案
21
+ find . -type d -name __pycache__ -delete
22
+ find . -type f -name "*.pyc" -delete
23
+
24
+ hf-login: ## 登入 Hugging Face
25
+ huggingface-cli login
26
+
27
+ deploy: ## 部署到 Hugging Face Spaces
28
+ git add .
29
+ git commit -m "Update application"
30
+ git push
31
+
32
+ requirements: ## 更新 requirements.txt
33
+ uv export --no-dev > requirements.txt
main.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ def main():
2
+ print("Hello from test!")
3
+
4
+
5
+ if __name__ == "__main__":
6
+ main()
pyproject.toml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ [project]
2
+ name = "test"
3
+ version = "0.1.0"
4
+ description = "Add your description here"
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ dependencies = [
8
+ "huggingface-hub>=0.32.4",
9
+ ]