Download Dockerfile.huggingface from Deeptanshuu/Multilingual_Toxic_Comment_Classifier: direct link, hf CLI and curl.
- Browser
- Download file 875 Bytes
-
https://huggingface.co/Deeptanshuu/Multilingual_Toxic_Comment_Classifier/resolve/main/Dockerfile.huggingface
- Command line
-
hf download hf://Deeptanshuu/Multilingual_Toxic_Comment_Classifier/Dockerfile.huggingface
-
curl -L -o Dockerfile.huggingface https://huggingface.co/Deeptanshuu/Multilingual_Toxic_Comment_Classifier/resolve/main/Dockerfile.huggingface
875 Bytes
| # Use CUDA-enabled PyTorch base image | |
| FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| wget \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements file | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy project files | |
| COPY . . | |
| # Create directories for data and models | |
| RUN mkdir -p weights | |
| # Set environment variables | |
| ENV PYTHONPATH=/app | |
| ENV ONNX_MODEL_PATH="weights/toxic_classifier.onnx" | |
| ENV PYTORCH_MODEL_DIR="weights/toxic_classifier_xlm-roberta-large" | |
| ENV PORT=7860 | |
| # Set the entry point to run the Streamlit app | |
| CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableCORS=false", "--server.enableXsrfProtection=false"] |