Files

44 lines
1.1 KiB
Bash

#!/bin/bash
# Photo Judgers — Reset Conda Environment (Linux/Mac)
# Deletes and recreates the conda env cleanly, then installs deps.
# Use this if setup keeps failing or the HF stack is corrupted.
set -e
ENV_NAME="photo_judgers"
echo "========================================"
echo " Photo Judgers — Reset Environment"
echo "========================================"
echo ""
if ! command -v conda &>/dev/null; then
echo "ERROR: conda not found."
exit 1
fi
# Remove existing env if present
if conda env list | grep -E "^\s*${ENV_NAME}\s*$" > /dev/null 2>&1; then
echo "Removing existing environment '${ENV_NAME}'..."
conda remove -y -n "${ENV_NAME}" --all
fi
echo ""
echo "Creating fresh environment '${ENV_NAME}' (Python 3.11)..."
conda create -y -n "${ENV_NAME}" python=3.11
echo ""
echo "Activating..."
conda activate "${ENV_NAME}"
echo ""
echo "Installing packages from requirements.txt..."
pip install -r requirements.txt
echo ""
echo "========================================"
echo " Reset complete!"
echo "========================================"
echo "To run:"
echo " ./run.sh"
echo ""