github-actions[bot] commited on
Commit
26a3dc1
ยท
1 Parent(s): e9000b4

sync from a8e426d

Browse files
Files changed (4) hide show
  1. .dockerignore +17 -0
  2. Dockerfile +24 -0
  3. README.md +7 -8
  4. scripts/hfPreload.py +31 -0
.dockerignore ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .git
2
+ .github
3
+ .venv
4
+ .venv-wsl
5
+ __pycache__
6
+ *.pyc
7
+ .pytest_cache
8
+ .ruff_cache
9
+ experiments
10
+ notebooks
11
+ tests
12
+ docs
13
+ blog
14
+ landing
15
+ data
16
+ .claude
17
+ *.egg-info
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # HuggingFace Spaces โ€” DartLab ๋ฐ๋ชจ
2
+ # CPU free tier (16GB RAM), port 7860
3
+
4
+ FROM python:3.12-slim
5
+
6
+ WORKDIR /app
7
+
8
+ # ์‹œ์Šคํ…œ ์˜์กด์„ฑ
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ build-essential \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # dartlab ์„ค์น˜
14
+ RUN pip install --no-cache-dir dartlab
15
+
16
+ # ์ƒ˜ํ”Œ ๋ฐ์ดํ„ฐ ํ”„๋ฆฌ๋กœ๋“œ ์Šคํฌ๋ฆฝํŠธ
17
+ COPY scripts/hfPreload.py scripts/hfPreload.py
18
+ RUN python scripts/hfPreload.py
19
+
20
+ # HF Spaces ๊ธฐ๋ณธ ํฌํŠธ
21
+ EXPOSE 7860
22
+
23
+ # ์„œ๋ฒ„ ์‹คํ–‰
24
+ CMD ["python", "-m", "dartlab.server"]
README.md CHANGED
@@ -1,12 +1,11 @@
1
  ---
2
- title: Dartlab
3
- emoji: ๐Ÿ†
4
- colorFrom: gray
5
- colorTo: red
6
  sdk: docker
7
- pinned: false
 
8
  license: mit
9
- short_description: DART + EDGAR disclosure analysis โ€” try without install
10
  ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: DartLab
3
+ emoji: ๐Ÿ“Š
4
+ colorFrom: red
5
+ colorTo: yellow
6
  sdk: docker
7
+ app_port: 7860
8
+ pinned: true
9
  license: mit
10
+ short_description: "DART + EDGAR disclosure analysis โ€” try without install"
11
  ---
 
 
scripts/hfPreload.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """HuggingFace Spaces Docker ๋นŒ๋“œ ์‹œ ์ƒ˜ํ”Œ ๋ฐ์ดํ„ฐ ํ”„๋ฆฌ๋กœ๋“œ.
2
+
3
+ ์‚ผ์„ฑ์ „์ž(005930)์™€ AAPL ๋ฐ์ดํ„ฐ๋ฅผ ๋ฏธ๋ฆฌ ๋‹ค์šด๋กœ๋“œํ•˜์—ฌ
4
+ cold start ์‹œ๊ฐ„์„ ์ค„์ธ๋‹ค.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import os
10
+ import sys
11
+
12
+ # Docker ๋นŒ๋“œ ํ™˜๊ฒฝ์—์„œ๋Š” dartlab์ด ์ด๋ฏธ pip install๋œ ์ƒํƒœ
13
+ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))
14
+
15
+ SAMPLES = ["005930", "AAPL"]
16
+
17
+
18
+ def main() -> None:
19
+ from dartlab.core.dataLoader import download
20
+
21
+ for code in SAMPLES:
22
+ print(f" preloading {code}...")
23
+ try:
24
+ download(code)
25
+ print(f" {code} done")
26
+ except Exception as e: # noqa: BLE001
27
+ print(f" {code} skipped: {e}")
28
+
29
+
30
+ if __name__ == "__main__":
31
+ main()