File size: 2,256 Bytes
03a7eb9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@echo off
REM Installation script for PyTorch and fine-tuning dependencies (Windows)
REM Run this to set up your environment correctly

echo.
echo ======================================
echo CODEARENA FINE-TUNING SETUP
echo ======================================
echo.

REM Check Python version
echo Checking Python...
python --version
if errorlevel 1 (
    echo ERROR: Python not found. Please install Python 3.9+ first.
    pause
    exit /b 1
)
echo.

REM Check GPU
echo Checking GPU availability...
python -c "
import torch
if torch.cuda.is_available():
    print(f'GPU: {torch.cuda.get_device_name(0)}')
    print(f'VRAM: {torch.cuda.get_device_properties(0).total_memory / 1e9:.1f}GB')
else:
    print('WARNING: No GPU detected - training will be slow')
" 2>nul || echo GPU check skipped
echo.

REM Install PyTorch (with CUDA 12.1 support)
echo Installing PyTorch...
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 -q
if errorlevel 1 (
    echo ERROR: Failed to install PyTorch
    echo Try installing manually:
    echo pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
    pause
    exit /b 1
)
echo PyTorch installed successfully
echo.

REM Install fine-tuning dependencies
echo Installing fine-tuning dependencies...
pip install -r requirements-finetune.txt -q
if errorlevel 1 (
    echo ERROR: Failed to install dependencies
    echo Try installing manually:
    echo pip install -r requirements-finetune.txt
    pause
    exit /b 1
)
echo Dependencies installed successfully
echo.

REM Verify installation
echo Verifying installation...
python -c "
import torch
import transformers
import peft
import trl
import datasets
print(f'PyTorch: {torch.__version__}')
print(f'Transformers: {transformers.__version__}')
print(f'PEFT: {peft.__version__}')
print(f'TRL: {trl.__version__}')
print(f'Datasets: {datasets.__version__}')
"
echo.

echo ======================================
echo SETUP COMPLETE
echo ======================================
echo.
echo Next steps:
echo 1. Run fine-tuning (interactive):
echo    python quickstart_finetune.py
echo.
echo 2. Or directly specify model:
echo    python finetune_models.py --model llama3.2 --num-epochs 3
echo.
pause