guydffdsdsfd commited on
Commit
76f1d28
·
verified ·
1 Parent(s): 631c6d3

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +8 -11
start.sh CHANGED
@@ -1,16 +1,13 @@
1
  #!/bin/bash
2
 
3
- # 1. Start the Python Guard Proxy in the background
4
- # This opens port 7860 immediately so Hugging Face sees the Space as "Live"
5
- python3 /home/user/app.py &
6
 
7
- # 2. Start the Stable Diffusion CPU Server in the background
8
- # We use a lightweight server (like fastsd-cpu or sd.cpp)
9
- # Here we assume you're using a python-based server for the backend
10
- python3 -m sd_backend_server --port 11434 --host 127.0.0.1 &
11
 
12
- echo "Waiting for CPU Model to initialize..."
13
- sleep 10
14
 
15
- # 3. Keep the container alive
16
- wait -n
 
1
  #!/bin/bash
2
 
3
+ # Optional: Print GPU info for debugging
4
+ nvidia-smi
 
5
 
6
+ # Optional: Pre-download model weights to the container cache
7
+ # to avoid timeout during the first user request
8
+ # python -c "from diffusers import DiffusionPipeline; DiffusionPipeline.from_pretrained('runwayml/stable-diffusion-v1-5')"
 
9
 
10
+ echo "Starting Stable Diffusion App..."
 
11
 
12
+ # Start the Python application
13
+ python app.py