hirann commited on
Commit
de0b648
·
verified ·
1 Parent(s): 8376c34

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -6
Dockerfile CHANGED
@@ -1,9 +1,33 @@
 
1
  FROM unsloth/unsloth:latest
 
 
2
  WORKDIR /app
3
- RUN /opt/venv/bin/python -m pip install --no-cache-dir -U huggingface_hub>=0.28.0 trl==0.15.0
4
- COPY ./requirements.txt requirements.txt
5
- RUN /opt/venv/bin/python -m pip install --no-cache-dir -r requirements.txt
6
- COPY . /app
7
- ENV PYTHONPATH=/app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ENV UNSLOTH_USE_VLLM=0
9
- ENTRYPOINT ["/opt/venv/bin/python", "training/launch_hf_training.py"]
 
 
 
 
 
 
1
+ # Use the official Unsloth image which has all training deps pre-installed
2
  FROM unsloth/unsloth:latest
3
+
4
+ USER root
5
  WORKDIR /app
6
+
7
+ # Install server-specific dependencies on top of the Unsloth environment
8
+ # We use the /opt/venv which is the standard location in Unsloth images
9
+ RUN /opt/venv/bin/pip install --no-cache-dir \
10
+ fastapi \
11
+ uvicorn[standard] \
12
+ gradio \
13
+ openenv-core \
14
+ networkx \
15
+ matplotlib \
16
+ plotly \
17
+ pyyaml \
18
+ rich
19
+
20
+ # Copy the project files
21
+ COPY . .
22
+
23
+ # Set environment variables
24
+ ENV PYTHONPATH="/app"
25
+ ENV GRADIO_ANALYTICS_ENABLED=False
26
+ # Disable vLLM to avoid Gemma3Config import errors in the Space
27
  ENV UNSLOTH_USE_VLLM=0
28
+
29
+ # Expose the default Gradio/FastAPI port
30
+ EXPOSE 7860
31
+
32
+ # Start the FastAPI server (which mounts the Gradio demo at /demo)
33
+ CMD ["/opt/venv/bin/python", "-m", "uvicorn", "server.main:app", "--host", "0.0.0.0", "--port", "7860"]