simpo-environment-setup
How to set up the correct Python environment for the SimPO project, specifically using Python 3.10 and resolving version conflicts. Use this when setting up the environment to run SimPO code and unit tests.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 92
- Forks
- 7
01 前言 Front Matter
- name
- simpo-environment-setup
- description
- How to set up the correct Python environment for the SimPO project, specifically using Python 3.10 and resolving version conflicts. Use this when setting up the environment to run SimPO code and unit tests.
03 SKILL.md 正文
SimPO Environment Setup
Critical: Use Python 3.10
The SimPO project and its tests require Python 3.10. If the system has a different Python version (e.g., 3.12), you must install and use Python 3.10 explicitly.
Step-by-step Setup
# 1. Install Python 3.10 using uv (or conda/pyenv)
uv python install 3.10
# 2. Create a virtual environment with Python 3.10
cd /root/SimPO
uv venv --python 3.10 .venv
# 3. Activate the virtual environment
source .venv/bin/activate
# 4. Verify Python version
python -VV
# Should show Python 3.10.x
# 5. Install project dependencies
# If there's a requirements.txt or setup.py:
pip install torch torchvision torchaudio
pip install transformers trl accelerate datasets
pip install numpy
# Or install from the project:
# pip install -e .
# 6. If there are conflicts with pre-installed packages (e.g., system torch for 3.12),
# the venv isolates you from those. Install everything fresh in the venv.
Generate python_info.txt
# Must be run with the Python 3.10 venv activated
python -VV > /root/python_info.txt 2>&1
python -m pip freeze >> /root/python_info.txt
Run the Unit Test
# With the Python 3.10 venv activated
cd /root/SimPO
python unit_test/unit_test_1.py
This will generate /root/loss.npz with key 'losses'.
Common Issues
- Wrong Python version: If
/root/python_info.txtshows Python 3.12, the test will fail. Always verifypython -VVshows 3.10. - Package conflicts: If system packages conflict, create a clean venv with Python 3.10.
- CUDA availability: The unit test may run on CPU. Ensure torch is installed correctly for the available hardware.
- uv tool: If
uvis available, it's the easiest way to install a specific Python version:uv python install 3.10 uv venv --python 3.10 /root/SimPO/.venv - Alternative with conda:
conda create -n simpo python=3.10 -y conda activate simpo pip install torch transformers trl accelerate datasets numpy
04 同仓库更多 Skills
object_counter
Count occurrences of an object in the image using computer vision algorithm.
travel-planning-workflow
Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.
bundled-dataset-search-tool
invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.
glm-output
Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final /root/metrics.json.
glm-calibration
Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.
glm-basics
A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.