Spaces:
Sleeping
Sleeping
Download scripts/setup_graphify.sh from baljot07/studiq-backend: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/spaces/baljot07/studiq-backend/resolve/main/scripts/setup_graphify.sh
- Command line
-
hf download hf://spaces/baljot07/studiq-backend/scripts/setup_graphify.sh
-
curl -L -o setup_graphify.sh https://huggingface.co/spaces/baljot07/studiq-backend/resolve/main/scripts/setup_graphify.sh
1.37 kB
| set -e | |
| # setup_graphify.sh — Sets up the isolated Python 3.13+ environment for graphify | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| BACKEND_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)" | |
| cd "${BACKEND_DIR}" | |
| echo "=== Setting up Graphify Environment ===" | |
| echo "Backend Dir: ${BACKEND_DIR}" | |
| # Check for python3 | |
| if ! command -v python3 &> /dev/null; then | |
| echo "ERROR: python3 is not installed on the system." | |
| exit 1 | |
| fi | |
| PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') | |
| echo "System Python version: ${PYTHON_VERSION}" | |
| # Check if version is >= 3.10 | |
| python3 -c 'import sys; exit(0 if sys.version_info >= (3, 10) else 1)' || { | |
| echo "ERROR: System python3 version must be >= 3.10 (got ${PYTHON_VERSION})" | |
| exit 1 | |
| } | |
| # Create virtual env if it doesn't exist | |
| if [ ! -d "graphify_venv" ]; then | |
| echo "Creating virtual environment 'graphify_venv'..." | |
| python3 -m venv graphify_venv | |
| else | |
| echo "Virtual environment 'graphify_venv' already exists." | |
| fi | |
| # Install/Upgrade graphifyy package | |
| echo "Installing graphifyy with PDF support inside venv..." | |
| nice -n 19 ./graphify_venv/bin/pip install --upgrade pip | |
| nice -n 19 ./graphify_venv/bin/pip install graphifyy[pdf] | |
| echo "Verifying installation..." | |
| ./graphify_venv/bin/graphify --version | |
| echo "=== Setup Completed Successfully ===" | |