Spaces:
Build error
Build error
Activate conda environment 'cosmos-predict1' in start.sh
Browse files
start.sh
CHANGED
|
@@ -4,7 +4,19 @@ set -eux # Keep this for debugging and seeing command execution
|
|
| 4 |
export CUDA_VISIBLE_DEVICES="0"
|
| 5 |
export CUDA_HOME="/usr/local/cuda"
|
| 6 |
|
| 7 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
export PYTHONPATH="/app:/app/gui/api"
|
| 9 |
|
| 10 |
echo "Starting GEN3C FastAPI inference server..."
|
|
@@ -13,4 +25,5 @@ export GEN3C_CKPT_PATH="/app/checkpoints"
|
|
| 13 |
export GEN3C_GPU_COUNT=1
|
| 14 |
|
| 15 |
# Start the FastAPI server
|
|
|
|
| 16 |
exec uvicorn gui.api.server:app --host 0.0.0.0 --port 7860 --proxy-headers
|
|
|
|
| 4 |
export CUDA_VISIBLE_DEVICES="0"
|
| 5 |
export CUDA_HOME="/usr/local/cuda"
|
| 6 |
|
| 7 |
+
# Source conda.sh to make 'conda' command available
|
| 8 |
+
# This finds the conda.sh script, which sets up the conda command in the shell.
|
| 9 |
+
# We try a few common installation paths for Miniconda/Anaconda.
|
| 10 |
+
source /opt/conda/etc/profile.d/conda.sh || \
|
| 11 |
+
source /usr/local/miniconda/etc/profile.d/conda.sh || \
|
| 12 |
+
source /root/miniconda/etc/profile.d/conda.sh || \
|
| 13 |
+
{ echo "ERROR: Could not find conda.sh script to source. Ensure Conda is installed correctly."; exit 1; }
|
| 14 |
+
|
| 15 |
+
# Activate the specific conda environment
|
| 16 |
+
conda activate cosmos-predict1 || { echo "ERROR: Failed to activate conda environment 'cosmos-predict1'. Ensure it exists."; exit 1; }
|
| 17 |
+
|
| 18 |
+
# Set PYTHONPATH *after* conda activation, as conda might modify PATH/PYTHONPATH itself.
|
| 19 |
+
# This ensures local project paths are prioritized/available for your application's modules.
|
| 20 |
export PYTHONPATH="/app:/app/gui/api"
|
| 21 |
|
| 22 |
echo "Starting GEN3C FastAPI inference server..."
|
|
|
|
| 25 |
export GEN3C_GPU_COUNT=1
|
| 26 |
|
| 27 |
# Start the FastAPI server
|
| 28 |
+
# It's crucial that 'uvicorn' is installed and available within the 'cosmos-predict1' environment.
|
| 29 |
exec uvicorn gui.api.server:app --host 0.0.0.0 --port 7860 --proxy-headers
|