Speedofmastery commited on
Commit
ea9f457
·
verified ·
1 Parent(s): 04e84b3

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. Dockerfile +18 -6
  2. app.py +13 -0
  3. requirements.txt +3 -0
Dockerfile CHANGED
@@ -1,10 +1,19 @@
1
- # Simple Python image for fast builds
2
- FROM python:3.10-slim
3
 
4
  # Set environment variables
5
- ENV PYTHONUNBUFFERED=1 \
 
6
  GRADIO_SERVER_NAME=0.0.0.0 \
7
- GRADIO_SERVER_PORT=7860
 
 
 
 
 
 
 
 
8
 
9
  # Set up user with ID 1000 (required by HuggingFace Spaces)
10
  RUN useradd -m -u 1000 user
@@ -19,13 +28,16 @@ ENV HOME=/home/user \
19
  # Set working directory
20
  WORKDIR $HOME/app
21
 
22
- # Copy requirements and install
23
  COPY --chown=user requirements.txt .
 
 
24
  RUN pip install --no-cache-dir --upgrade pip && \
25
  pip install --no-cache-dir "numpy<2" && \
 
26
  pip install --no-cache-dir -r requirements.txt
27
 
28
- # Copy application files
29
  COPY --chown=user app.py .
30
 
31
  # Expose Gradio port
 
1
+ # NVIDIA CUDA base image for A10G Large GPU
2
+ FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
3
 
4
  # Set environment variables
5
+ ENV DEBIAN_FRONTEND=noninteractive \
6
+ PYTHONUNBUFFERED=1 \
7
  GRADIO_SERVER_NAME=0.0.0.0 \
8
+ GRADIO_SERVER_PORT=7860 \
9
+ CUDA_HOME=/usr/local/cuda
10
+
11
+ # Install Python 3.10 and essential tools
12
+ RUN apt-get update && apt-get install -y \
13
+ python3.10 \
14
+ python3-pip \
15
+ && rm -rf /var/lib/apt/lists/* \
16
+ && ln -s /usr/bin/python3.10 /usr/bin/python
17
 
18
  # Set up user with ID 1000 (required by HuggingFace Spaces)
19
  RUN useradd -m -u 1000 user
 
28
  # Set working directory
29
  WORKDIR $HOME/app
30
 
31
+ # Copy requirements
32
  COPY --chown=user requirements.txt .
33
+
34
+ # Install Python packages with CUDA support
35
  RUN pip install --no-cache-dir --upgrade pip && \
36
  pip install --no-cache-dir "numpy<2" && \
37
+ pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 && \
38
  pip install --no-cache-dir -r requirements.txt
39
 
40
+ # Copy application
41
  COPY --chown=user app.py .
42
 
43
  # Expose Gradio port
app.py CHANGED
@@ -5,6 +5,19 @@ import sqlite3
5
  import hashlib
6
  import datetime
7
  from pathlib import Path
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  # Cloudflare configuration
10
  CLOUDFLARE_CONFIG = {
 
5
  import hashlib
6
  import datetime
7
  from pathlib import Path
8
+ import torch
9
+
10
+ # GPU Verification
11
+ print("=" * 50)
12
+ print("🚀 ORYNXML AI Platform - GPU Check")
13
+ print("=" * 50)
14
+ print(f"Is CUDA available: {torch.cuda.is_available()}")
15
+ if torch.cuda.is_available():
16
+ print(f"CUDA device count: {torch.cuda.device_count()}")
17
+ print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
18
+ print(f"CUDA version: {torch.version.cuda}")
19
+ print(f"PyTorch version: {torch.__version__}")
20
+ print("=" * 50)
21
 
22
  # Cloudflare configuration
23
  CLOUDFLARE_CONFIG = {
requirements.txt CHANGED
@@ -1 +1,4 @@
 
 
1
  gradio>=4.0
 
 
1
+ --extra-index-url https://download.pytorch.org/whl/cu118
2
+ torch
3
  gradio>=4.0
4
+ numpy<2