BPO-Bench / Dockerfile
haroldshipibm's picture
Upload folder using huggingface_hub
3cfa5b5 verified
FROM python:3.12-slim
# Set up user for HuggingFace Spaces
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Install dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY --chown=user . .
# Download data from HF Dataset on build (all task suites + fixture data)
RUN python -c "from huggingface_hub import hf_hub_download; \
import os; os.makedirs('data', exist_ok=True); \
r='ibm-research/BPO-Bench'; d='dataset'; \
hf_hub_download(r, 'candidate_data.parquet', local_dir='data', repo_type=d); \
hf_hub_download(r, 'tasks.json', local_dir='data', repo_type=d); \
hf_hub_download(r, 'tasks_type_mismatch.json', local_dir='data', repo_type=d); \
hf_hub_download(r, 'tasks_http_errors.json', local_dir='data', repo_type=d); \
hf_hub_download(r, 'tasks_schema_violations.json', local_dir='data', repo_type=d); \
hf_hub_download(r, 'tasks_edge_cases.json', local_dir='data', repo_type=d); \
hf_hub_download(r, 'tasks_undocumented.json', local_dir='data', repo_type=d); \
hf_hub_download(r, 'large_response_fixture.json', local_dir='data', repo_type=d)"
# Expose port for Gradio
EXPOSE 7860
# Start the application
CMD ["python", "app.py"]