Spaces:
Running
Running
TM23-sanji commited on
Commit ·
dd80bb4
1
Parent(s): c987dd2
feat: add app.py entry point, configure Docker for local package installation, and update README for HuggingFace Spaces deployment
Browse files- Dockerfile +12 -5
- README.md +10 -0
- app.py +11 -0
Dockerfile
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
# Dockerfile for HuggingFace Spaces deployment
|
| 2 |
-
#
|
| 3 |
|
| 4 |
FROM python:3.11-slim
|
| 5 |
|
| 6 |
-
# Install Rust (minimal installation)
|
| 7 |
RUN apt-get update && apt-get install -y curl && \
|
| 8 |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal && \
|
| 9 |
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
@@ -19,12 +19,19 @@ COPY requirements.txt .
|
|
| 19 |
# Install Python dependencies
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
COPY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
# Expose port (HF Spaces uses 7860 by default)
|
| 26 |
EXPOSE 7860
|
| 27 |
|
| 28 |
# Run the server
|
| 29 |
# HF Spaces automatically starts containers with: python app.py
|
| 30 |
-
CMD ["python", "
|
|
|
|
| 1 |
# Dockerfile for HuggingFace Spaces deployment
|
| 2 |
+
# Optimized for HF Spaces which run as root by default
|
| 3 |
|
| 4 |
FROM python:3.11-slim
|
| 5 |
|
| 6 |
+
# Install Rust (minimal installation with rustc only)
|
| 7 |
RUN apt-get update && apt-get install -y curl && \
|
| 8 |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal && \
|
| 9 |
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
| 19 |
# Install Python dependencies
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
+
# Install the algo_reasoning_env package in editable mode
|
| 23 |
+
COPY algo_reasoning_env/ /app/algo_reasoning_env/
|
| 24 |
+
RUN pip install --no-cache-dir -e /app/algo_reasoning_env
|
| 25 |
+
|
| 26 |
+
# Copy dataset files to /data/
|
| 27 |
+
COPY complexity_reasoning_data/ /data/
|
| 28 |
+
|
| 29 |
+
# Copy entry point
|
| 30 |
+
COPY app.py .
|
| 31 |
|
| 32 |
# Expose port (HF Spaces uses 7860 by default)
|
| 33 |
EXPOSE 7860
|
| 34 |
|
| 35 |
# Run the server
|
| 36 |
# HF Spaces automatically starts containers with: python app.py
|
| 37 |
+
CMD ["python", "app.py"]
|
README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Algo Reasoning Environment
|
| 2 |
|
| 3 |
An OpenEnv-compatible environment that evaluates AI agents on their ability to solve LeetCode-style problems in Rust, providing accurate reasoning and time complexity analysis.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Algo Reasoning Environment
|
| 3 |
+
emoji: 🧠
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: gray
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_file: app.py
|
| 8 |
+
pinned: false
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
# Algo Reasoning Environment
|
| 12 |
|
| 13 |
An OpenEnv-compatible environment that evaluates AI agents on their ability to solve LeetCode-style problems in Rust, providing accurate reasoning and time complexity analysis.
|
app.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
HuggingFace Spaces entry point for the Algo Reasoning Environment.
|
| 3 |
+
|
| 4 |
+
This file serves as the entry point for HF Spaces Docker deployment.
|
| 5 |
+
It imports and runs the FastAPI app from algo_reasoning_env.server.app.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
from algo_reasoning_env.server.app import app, main
|
| 9 |
+
|
| 10 |
+
if __name__ == "__main__":
|
| 11 |
+
main()
|