Deeptanshuu commited on
Commit
85a8c27
·
1 Parent(s): d01b8b8

dockerfile

Browse files
Files changed (3) hide show
  1. .gitignore +1 -0
  2. Dockerfile.huggingface +32 -0
  3. space.yml +7 -0
.gitignore CHANGED
@@ -12,6 +12,7 @@ myenv/
12
 
13
  *.md
14
 
 
15
  # Gradio
16
  .gradio/*
17
 
 
12
 
13
  *.md
14
 
15
+
16
  # Gradio
17
  .gradio/*
18
 
Dockerfile.huggingface ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use CUDA-enabled PyTorch base image
2
+ FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ git \
10
+ wget \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Copy requirements file
14
+ COPY requirements.txt .
15
+
16
+ # Install Python dependencies
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy project files
20
+ COPY . .
21
+
22
+ # Create directories for data and models
23
+ RUN mkdir -p weights
24
+
25
+ # Set environment variables
26
+ ENV PYTHONPATH=/app
27
+ ENV ONNX_MODEL_PATH="weights/toxic_classifier.onnx"
28
+ ENV PYTORCH_MODEL_DIR="weights/toxic_classifier_xlm-roberta-large"
29
+ ENV PORT=7860
30
+
31
+ # Set the entry point to run the Streamlit app
32
+ CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableCORS=false", "--server.enableXsrfProtection=false"]
space.yml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ title: Multilingual Toxic Comment Classifier
2
+ emoji: 🛡️
3
+ colorFrom: indigo
4
+ colorTo: blue
5
+ sdk: docker
6
+ pinned: false
7
+ license: mit