Views
No views yet
1# Download and install everything
2from huggingface_hub import snapshot_download
3import subprocess
4import os
5
6# Download all wheels
7repo_path = snapshot_download(repo_id="RDHub/pytorch_python_310")
8wheel_path = os.path.join(repo_path, "lib_wheel")
9
10# Install all wheels
11subprocess.run(["pip", "install"] + [f"{wheel_path}/*.whl"], shell=True)1# 1. Download repository
2git clone https://huggingface.co/RDHub/pytorch_python_310
3
4# 2. Install everything with requirements file for correct versions
5cd pytorch_python_310
6pip install -r lib_wheel/requirements.txt --find-links lib_wheel --no-index
7
8# 3. Set up CUDA libraries (for conda environments)
9# Create activation script for automatic library path setup
10mkdir -p $CONDA_PREFIX/etc/conda/activate.d
11cat > $CONDA_PREFIX/etc/conda/activate.d/pytorch_cuda_libs.sh << 'EOF'
12#!/bin/bash
13# Set up NVIDIA CUDA library paths for PyTorch
14NVIDIA_LIB_PATH=$(find $CONDA_PREFIX -path "*/nvidia/*/lib" -type d 2>/dev/null | tr '\n' ':')
15CUSPARSELT_LIB_PATH=$(find $CONDA_PREFIX -path "*/cusparselt/lib" -type d 2>/dev/null | tr '\n' ':')
16export LD_LIBRARY_PATH="${NVIDIA_LIB_PATH}${CUSPARSELT_LIB_PATH}${LD_LIBRARY_PATH}"
17EOF
18chmod +x $CONDA_PREFIX/etc/conda/activate.d/pytorch_cuda_libs.sh
19
20# 4. Reactivate environment and test
21conda deactivate && conda activate your_env_name
22python -c "import torch; print(f'PyTorch {torch.__version__} - CUDA: {torch.cuda.is_available()}')"| Package | Version | Python |
|---|---|---|
| PyTorch | 2.7.1 | 3.10 |
| Transformers | 4.52.3 | 3.10 |
| NumPy | 2.0.2 | 3.10 |
| CUDA | 12.6 | - |