alextorelli commited on
Commit
6888b61
·
verified ·
1 Parent(s): bf8b9d6

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. Dockerfile +25 -0
  2. README.md +2 -4
  3. app.py +2 -1
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ git \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Copy requirements and install Python packages
11
+ COPY requirements.txt .
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # Copy application code
15
+ COPY app.py .
16
+
17
+ # Expose port
18
+ EXPOSE 7860
19
+
20
+ # Set environment variables
21
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
22
+ ENV GRADIO_SERVER_PORT=7860
23
+
24
+ # Run the application
25
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
README.md CHANGED
@@ -3,12 +3,10 @@ title: code-chef ModelOps Trainer
3
  emoji: 🏗️
4
  colorFrom: blue
5
  colorTo: purple
6
- sdk: gradio
7
- sdk_version: 4.44.0
8
- app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
- duplicated_from: appsmithery/code-chef-modelops-trainer
12
  hardware: t4-small
13
  ---
14
 
 
3
  emoji: 🏗️
4
  colorFrom: blue
5
  colorTo: purple
6
+ sdk: docker
7
+ app_port: 7860
 
8
  pinned: false
9
  license: apache-2.0
 
10
  hardware: t4-small
11
  ---
12
 
app.py CHANGED
@@ -340,5 +340,6 @@ with gr.Blocks(title="code-chef ModelOps Trainer") as demo:
340
  """
341
  )
342
 
343
- # Mount Gradio to root and FastAPI routes available at /api/*
 
344
  app = gr.mount_gradio_app(app, demo, path="/")
 
340
  """
341
  )
342
 
343
+ # Mount Gradio interface to FastAPI app at root path
344
+ # HuggingFace Spaces will auto-detect and run the FastAPI app
345
  app = gr.mount_gradio_app(app, demo, path="/")