Kentlo commited on
Commit
cd5fc3c
Β·
1 Parent(s): 8f0fa74

πŸš€ Deploy to Hugging Face Spaces (removed large files)

Browse files
Files changed (2) hide show
  1. README.md +35 -0
  2. deploy_to_spaces.py +53 -1
README.md ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Cert Study App
3
+ emoji: πŸ“š
4
+ colorFrom: blue
5
+ colorTo: green
6
+ sdk: gradio
7
+ sdk_version: "4.0.0"
8
+ app_file: app.py
9
+ pinned: false
10
+ license: apache-2.0
11
+ ---
12
+
13
+ # Cert Study App πŸ“š
14
+
15
+ AI-powered certification exam study application with intelligent question generation and adaptive learning.
16
+
17
+ ## Features
18
+
19
+ - πŸ“„ PDF parsing with OCR support
20
+ - πŸ€– AI-powered question generation
21
+ - πŸ“Š Study progress tracking
22
+ - 🎯 Adaptive learning system
23
+ - πŸ” Semantic search for questions
24
+
25
+ ## Usage
26
+
27
+ Upload your study materials and start practicing with AI-generated questions tailored to your learning needs.
28
+
29
+ ## Tech Stack
30
+
31
+ - Flask
32
+ - LangChain
33
+ - ChromaDB
34
+ - PaddleOCR
35
+ - Hugging Face Transformers
deploy_to_spaces.py CHANGED
@@ -62,7 +62,7 @@ hf_token = get_hf_token()
62
  AUTH_REPO_URL = f"https://{HF_USERNAME}:{hf_token}@huggingface.co/spaces/{HF_USERNAME}/{SPACE_NAME}"
63
 
64
  # ======================================================
65
- # 🧰 3️⃣ ν•„μˆ˜ 파일 생성 (requirements.txt, runtime.txt, .env)
66
  # ======================================================
67
  print("\nπŸ“¦ ν•„μˆ˜ 파일 생성 쀑...")
68
 
@@ -89,6 +89,43 @@ paddlepaddle-gpu
89
 
90
  runtime = "python-3.10\n"
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  env_template = """# 둜컬 μ‹€ν–‰μš© ν™˜κ²½ λ³€μˆ˜
93
  # ⚠️ 이 νŒŒμΌμ€ μ ˆλŒ€ Git에 μ˜¬λ¦¬μ§€ λ§ˆμ„Έμš”!
94
 
@@ -105,6 +142,21 @@ print("βœ… requirements.txt 생성 μ™„λ£Œ")
105
  Path("runtime.txt").write_text(runtime, encoding="utf-8")
106
  print("βœ… runtime.txt 생성 μ™„λ£Œ")
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  # πŸ” .envκ°€ 이미 있으면 μœ μ§€, 없을 λ•Œλ§Œ ν…œν”Œλ¦Ώ 생성
109
  env_path = Path(".env")
110
  if not env_path.exists():
 
62
  AUTH_REPO_URL = f"https://{HF_USERNAME}:{hf_token}@huggingface.co/spaces/{HF_USERNAME}/{SPACE_NAME}"
63
 
64
  # ======================================================
65
+ # 🧰 3️⃣ ν•„μˆ˜ 파일 생성 (requirements.txt, runtime.txt, README.md, .env)
66
  # ======================================================
67
  print("\nπŸ“¦ ν•„μˆ˜ 파일 생성 쀑...")
68
 
 
89
 
90
  runtime = "python-3.10\n"
91
 
92
+ readme = """---
93
+ title: Cert Study App
94
+ emoji: πŸ“š
95
+ colorFrom: blue
96
+ colorTo: green
97
+ sdk: gradio
98
+ sdk_version: "4.0.0"
99
+ app_file: app.py
100
+ pinned: false
101
+ license: apache-2.0
102
+ ---
103
+
104
+ # Cert Study App πŸ“š
105
+
106
+ AI-powered certification exam study application with intelligent question generation and adaptive learning.
107
+
108
+ ## Features
109
+
110
+ - πŸ“„ PDF parsing with OCR support
111
+ - πŸ€– AI-powered question generation
112
+ - πŸ“Š Study progress tracking
113
+ - 🎯 Adaptive learning system
114
+ - πŸ” Semantic search for questions
115
+
116
+ ## Usage
117
+
118
+ Upload your study materials and start practicing with AI-generated questions tailored to your learning needs.
119
+
120
+ ## Tech Stack
121
+
122
+ - Flask
123
+ - LangChain
124
+ - ChromaDB
125
+ - PaddleOCR
126
+ - Hugging Face Transformers
127
+ """
128
+
129
  env_template = """# 둜컬 μ‹€ν–‰μš© ν™˜κ²½ λ³€μˆ˜
130
  # ⚠️ 이 νŒŒμΌμ€ μ ˆλŒ€ Git에 μ˜¬λ¦¬μ§€ λ§ˆμ„Έμš”!
131
 
 
142
  Path("runtime.txt").write_text(runtime, encoding="utf-8")
143
  print("βœ… runtime.txt 생성 μ™„λ£Œ")
144
 
145
+ # README.md 생성
146
+ readme_path = Path("README.md")
147
+ if not readme_path.exists():
148
+ readme_path.write_text(readme, encoding="utf-8")
149
+ print("βœ… README.md 생성 μ™„λ£Œ")
150
+ else:
151
+ # κΈ°μ‘΄ READMEκ°€ 있으면 frontmatter 확인
152
+ content = readme_path.read_text(encoding="utf-8")
153
+ if not content.startswith("---"):
154
+ # frontmatterκ°€ μ—†μœΌλ©΄ μΆ”κ°€
155
+ readme_path.write_text(readme + "\n\n" + content, encoding="utf-8")
156
+ print("βœ… README.md에 Hugging Face μ„€μ • μΆ”κ°€")
157
+ else:
158
+ print("ℹ️ README.mdκ°€ 이미 μ‘΄μž¬ν•©λ‹ˆλ‹€ (μœ μ§€)")
159
+
160
  # πŸ” .envκ°€ 이미 있으면 μœ μ§€, 없을 λ•Œλ§Œ ν…œν”Œλ¦Ώ 생성
161
  env_path = Path(".env")
162
  if not env_path.exists():