Spaces:
Sleeping
Sleeping
github-actions[bot] commited on
Commit ยท
26a3dc1
1
Parent(s): e9000b4
sync from a8e426d
Browse files- .dockerignore +17 -0
- Dockerfile +24 -0
- README.md +7 -8
- 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:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
-
|
|
|
|
| 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()
|