Spaces:
Runtime error
Runtime error
Download Dockerfile from rabiyulfahim/qa_python_k2_think_api_UI: direct link, hf CLI and curl.
- Browser
- Download file 864 Bytes
-
https://huggingface.co/spaces/rabiyulfahim/qa_python_k2_think_api_UI/resolve/01134fc0fa50cb31d98d28584a02ea68d7975430/Dockerfile
- Command line
-
hf download hf://spaces/rabiyulfahim/qa_python_k2_think_api_UI@01134fc0fa50cb31d98d28584a02ea68d7975430/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/rabiyulfahim/qa_python_k2_think_api_UI/resolve/01134fc0fa50cb31d98d28584a02ea68d7975430/Dockerfile
864 Bytes
| # Use lightweight Python base image | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY . . | |
| # ✅ Hugging Face cache directory | |
| ENV HF_HOME=/tmp | |
| # ENV TRANSFORMERS_CACHE=/tmp | |
| # Pre-download K2-Think model to avoid cold start | |
| # RUN python -c "from transformers import AutoTokenizer, AutoModelForCausalLM; \ | |
| # model_id='LLM360/K2-Think'; \ | |
| # AutoTokenizer.from_pretrained(model_id, cache_dir='/tmp'); \ | |
| # AutoModelForCausalLM.from_pretrained(model_id, cache_dir='/tmp')" | |
| # Expose port | |
| EXPOSE 7860 | |
| # Command to run the FastAPI app | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |