CoolFace
Apppublic

vmjn/kronos-forecast

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes
Dockerfile65 linesDownload Raw Back to root
1FROM python:3.11-slim2 3RUN apt-get update && apt-get install -y --no-install-recommends \4    git build-essential curl wget \5    && rm -rf /var/lib/apt/lists/*6 7# Create user matching HF Space conventions8RUN useradd -m -u 1000 user9USER user10ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH11WORKDIR /home/user/app12 13# Disable TiRex CUDA kernels (we're on CPU-only Space)14ENV TIREX_NO_CUDA=1 XLSTM_USE_CUDA_KERNELS=015 16# Core: Torch CPU (keep 2.4.1 — Kronos meta-tensor compatibility)17RUN pip install --no-cache-dir --upgrade pip && \18    pip install --no-cache-dir torch==2.4.1 --index-url https://download.pytorch.org/whl/cpu19 20# Transformers bumped to 4.55.0 for TimesFm2_5 support21RUN pip install --no-cache-dir \22    "transformers==4.55.0" \23    "huggingface_hub>=0.27.0,<1.0" \24    "gradio[mcp]==5.30.0" \25    "websockets>=13" \26    "einops" \27    "safetensors" \28    "pandas" \29    "numpy<2.3"30 31# Chronos + TimesFM (fallback) + yfinance + sentiment32RUN pip install --no-cache-dir \33    "chronos-forecasting>=1.5.2" \34    "timesfm[torch]>=1.3.0" \35    "yfinance>=0.2.50" \36    "curl_cffi>=0.7" \37    "sentencepiece" \38    "tokenizers"39 40# NEW: MOMENT (anomaly detection)41RUN pip install --no-cache-dir "momentfm>=0.1.4"42 43# NEW: GDELT (news streaming)44RUN pip install --no-cache-dir "gdeltdoc>=1.5.0"45 46# NEW: requests for Reddit47RUN pip install --no-cache-dir "requests>=2.31" "beautifulsoup4>=4.12"48 49# NEW: TiRex (xLSTM TSFM) — install from git, CPU experimental mode50# Use || true so build doesn't fail if tirex install hits issues — endpoint will error gracefully51RUN pip install --no-cache-dir git+https://github.com/NX-AI/tirex.git || \52    echo "WARNING: TiRex install failed — /forecast_tirex will return error"53 54# Kronos model repo55USER user56RUN mkdir -p /home/user/app/model57COPY --chown=user ./model /home/user/app/model58COPY --chown=user ./app.py /home/user/app/app.py59 60# Pre-create HF cache dirs with right perms61RUN mkdir -p /home/user/.cache/huggingface62 63EXPOSE 786064CMD ["python", "app.py"]65