victorgg commited on
Commit
a8f9381
·
verified ·
1 Parent(s): 19f9b14

Create startup.sh

Browse files
Files changed (1) hide show
  1. startup.sh +32 -0
startup.sh ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Set the model name and URL
4
+ MODEL_NAME="reswapper-429500.pth" # Or the name of your model file
5
+ MODEL_URL="https://huggingface.co/somanchiu/reswapper/resolve/main/reswapper-429500.pth" # Replace with your model's URL
6
+
7
+ # Check if the model already exists. If so, skip the download
8
+ if [ ! -f "$MODEL_NAME" ]; then
9
+ echo "Downloading model $MODEL_NAME from $MODEL_URL..."
10
+ wget "$MODEL_URL" -O "$MODEL_NAME"
11
+ if [ $? -eq 0 ]; then # Check wget exit code (0 means success)
12
+ echo "Model $MODEL_NAME downloaded successfully."
13
+ else
14
+ echo "Error downloading model $MODEL_NAME. Check the URL and network connection."
15
+ exit 1 # Exit the script with an error code
16
+ fi
17
+ else
18
+ echo "Model $MODEL_NAME already exists. Skipping download."
19
+ fi
20
+
21
+
22
+ # (Optional) Download other files if needed - follow the same pattern as above:
23
+ # OTHER_FILE="other_file.txt"
24
+ # OTHER_URL="https://example.com/other_file.txt"
25
+ # if [ ! -f "$OTHER_FILE" ]; then
26
+ # wget "$OTHER_URL" -O "$OTHER_FILE"
27
+ # fi
28
+
29
+ # Start your Gradio app
30
+ echo "Starting Gradio app..."
31
+ python app.py
32
+