Spaces:
Runtime error
Runtime error
VikramSingh178
commited on
Commit
β’
5765ffb
1
Parent(s):
447ff26
added setup script
Browse files
run.sh
CHANGED
@@ -1,2 +1,36 @@
|
|
1 |
-
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
# Install necessary packages
|
4 |
+
sudo apt-get install -y python3-venv python3-pip
|
5 |
+
sudo apt install -y libgl1-mesa-glx
|
6 |
+
|
7 |
+
# Remove the old virtual environment if it exists and create a new one
|
8 |
+
if [ -d ".venv" ]; then
|
9 |
+
rm -rf .venv
|
10 |
+
fi
|
11 |
+
|
12 |
+
python3 -m venv .venv
|
13 |
+
|
14 |
+
# Activate the virtual environment
|
15 |
+
if [ -f ".venv/bin/activate" ]; then
|
16 |
+
source .venv/bin/activate
|
17 |
+
else
|
18 |
+
echo "Failed to create the virtual environment. Please check for errors."
|
19 |
+
exit 1
|
20 |
+
fi
|
21 |
+
|
22 |
+
# Install the uv package within the virtual environment
|
23 |
+
pip install uv
|
24 |
+
|
25 |
+
# Change directory to api and install the required packages
|
26 |
+
cd api || { echo "API directory not found"; exit 1; }
|
27 |
+
pip install -r requirements.txt
|
28 |
+
|
29 |
+
# Ensure the uv command is available
|
30 |
+
if ! command -v uv &> /dev/null; then
|
31 |
+
echo "uv command not found. Ensure it is installed and accessible."
|
32 |
+
exit 1
|
33 |
+
fi
|
34 |
+
|
35 |
+
# Run your uv-related command here, if needed
|
36 |
+
# uv <your_command_here>
|