Spaces:
Sleeping
Sleeping
set -e | |
echo "Setting up for real GGUF quantization..." | |
# Clone llama.cpp | |
if [ ! -d "llama.cpp" ]; then | |
echo "Cloning llama.cpp repository..." | |
git clone --depth=1 https://github.com/ggerganov/llama.cpp | |
fi | |
cd llama.cpp | |
# Get conversion script | |
echo "Setting up conversion script..." | |
if [ -f "convert.py" ]; then | |
echo "Found existing convert.py script" | |
elif [ -f "convert-hf-to-gguf.py" ]; then | |
echo "Found convert-hf-to-gguf.py" | |
cp convert-hf-to-gguf.py convert.py | |
elif [ -f "examples/convert-hf-to-gguf.py" ]; then | |
echo "Found examples/convert-hf-to-gguf.py" | |
cp examples/convert-hf-to-gguf.py convert.py | |
else | |
echo "Cannot find conversion script. Using Python alternative." | |
# Install required packages | |
pip install -q transformers torch | |
fi | |
# Install required packages for the conversion script | |
pip install -q transformers torch | |
# Initialize state file | |
cd .. | |
if [ ! -f "state.json" ]; then | |
echo "Initializing state file..." | |
echo '{"last_checked": null, "last_commit_hash": null, "is_up_to_date": true, "is_processing": false, "current_quant": null, "progress": 0, "total_quants": 12, "completed_quants": [], "failed_quants": [], "out_of_memory": false, "last_error": null, "status_message": "Ready to check for updates"}' > state.json | |
fi | |
# Create necessary directories | |
echo "Creating directories..." | |
mkdir -p model_cache | |
mkdir -p temp_outputs | |
echo "Setup completed successfully" | |