Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- Dockerfile +45 -0
- requirements.txt +26 -0
Dockerfile
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Optimized Dockerfile for Hugging Face Spaces
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# Install system dependencies
|
| 7 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
+
build-essential \
|
| 9 |
+
gcc \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# Copy requirements and install Python dependencies
|
| 13 |
+
COPY requirements.txt .
|
| 14 |
+
|
| 15 |
+
# Install dependencies in stages for better caching
|
| 16 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 17 |
+
pip install --no-cache-dir \
|
| 18 |
+
fastapi==0.104.0 \
|
| 19 |
+
uvicorn[standard]==0.24.0 \
|
| 20 |
+
pydantic==2.5.0 \
|
| 21 |
+
python-multipart==0.0.6 \
|
| 22 |
+
python-dotenv==1.0.0 \
|
| 23 |
+
requests==2.31.0 \
|
| 24 |
+
googletrans==4.0.0rc1 \
|
| 25 |
+
langdetect==1.0.9 && \
|
| 26 |
+
pip install --no-cache-dir \
|
| 27 |
+
numpy==1.24.0 \
|
| 28 |
+
pandas==2.0.0 \
|
| 29 |
+
scikit-learn==1.3.0 && \
|
| 30 |
+
pip install --no-cache-dir \
|
| 31 |
+
torch==2.0.0 \
|
| 32 |
+
transformers==4.35.0 \
|
| 33 |
+
sentence-transformers==2.2.0
|
| 34 |
+
|
| 35 |
+
# Copy application code
|
| 36 |
+
COPY . .
|
| 37 |
+
|
| 38 |
+
# Expose port (Hugging Face Spaces uses 7860 by default)
|
| 39 |
+
EXPOSE 7860
|
| 40 |
+
|
| 41 |
+
# Set environment variable for port
|
| 42 |
+
ENV PORT=7860
|
| 43 |
+
|
| 44 |
+
# Start the application
|
| 45 |
+
CMD ["python", "app.py"]
|
requirements.txt
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# InLegalBERT Bias Detection & Outcome Prediction Dependencies
|
| 2 |
+
# ============================================================
|
| 3 |
+
|
| 4 |
+
# Core ML/AI Libraries
|
| 5 |
+
torch>=2.0.0
|
| 6 |
+
transformers>=4.35.0
|
| 7 |
+
sentence-transformers>=2.2.0
|
| 8 |
+
|
| 9 |
+
# API Framework
|
| 10 |
+
fastapi>=0.104.0
|
| 11 |
+
uvicorn[standard]>=0.24.0
|
| 12 |
+
pydantic>=2.5.0
|
| 13 |
+
|
| 14 |
+
# Data Processing
|
| 15 |
+
numpy>=1.24.0
|
| 16 |
+
pandas>=2.0.0
|
| 17 |
+
scikit-learn>=1.3.0
|
| 18 |
+
|
| 19 |
+
# Utilities
|
| 20 |
+
python-multipart>=0.0.6
|
| 21 |
+
python-dotenv>=1.0.0
|
| 22 |
+
requests>=2.31.0
|
| 23 |
+
|
| 24 |
+
# Hackathon Features
|
| 25 |
+
googletrans==4.0.0rc1
|
| 26 |
+
langdetect>=1.0.9
|