Run Unit Test in Python 3.10 Environment

Use to execute the unit test within the Python 3.10 virtual environment after implementing the loss function. This validates the implementation against fixed input tensors.

cxcscmu Updated

File contents

  1. Ensure Python 3.10 environment is active:

    source /root/.venv310/bin/activate
    python -VV
    
  2. Navigate to project root:

    cd /root/SimPO
    
  3. Run the unit test:

    python unit_test/unit_test_1.py
    
  4. Verify output file was created:

    ls -lh /root/loss.npz
    
  5. Inspect the saved loss values (optional verification):

    python -c "import numpy as np; data = np.load('/root/loss.npz'); print(data['losses'])"
    
  6. Check for any error messages:

    • If test fails, review error traceback
    • Verify tensor shapes match test expectations
    • Confirm loss computation logic against paper formula

cxcscmu/SkillLearnBench commit a3fba84141

Frequently asked questions

npx get-skill add cxcscmu/run-unit-test-in-python-3-10-environment