We welcome contributions! Hereβs how to get started:
1. Fork and Clone
1
2
3
4
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/slm.git
cd slm
git remote add upstream https://github.com/isathish/slm.git
2. Create a Branch
Use descriptive branch names:
1
2
3
4
5
6
7
8
# For features
git checkout -b feat/add-new-loader
# For bug fixes
git checkout -b fix/resolve-memory-leak
# For documentation
git checkout -b docs/update-api-reference
SLM Builder uses automated semantic versioning based on commit messages.
Automatic Releases (Recommended)
Releases are automatically created when you push to main:
1
2
3
4
5
6
7
8
9
10
11
# This will create a minor release (e.g., 1.0.0 β 1.1.0)
git commit -m"feat: Add new evaluation metric"
git push origin main
# This will create a patch release (e.g., 1.1.0 β 1.1.1)
git commit -m"fix: Resolve tokenization issue"
git push origin main
# This will create a major release (e.g., 1.1.1 β 2.0.0)
git commit -m"BREAKING CHANGE: Change API interface"
git push origin main
How it works:
Auto-release workflow analyzes commit messages
Determines version bump type (major/minor/patch)
Updates VERSION file
Creates git tag (e.g., v1.2.3)
Release workflow generates release notes
GitHub release is created automatically
Manual Releases
If you need to create a release manually:
Option 1: Using the script
1
./create-release.sh
Follow the interactive prompts to select version bump type.
Option 2: Manual tag
1
2
3
# Create and push a tag
git tag -a v1.2.3 -m"Release v1.2.3"
git push origin v1.2.3
# Run all tests
pytest
# Run with coverage
pytest --cov=slm_builder --cov-report=html
# Run specific test file
pytest tests/unit/test_models.py
# Run specific test
pytest tests/unit/test_models.py::test_model_loading
# Run with verbose output
pytest -v
# Format code with black
black slm_builder/ tests/
# Check formatting
black --check slm_builder/ tests/
# Sort imports
isort slm_builder/ tests/
# Lint with flake8
flake8 slm_builder/ tests/
# Type checking with mypy
mypy slm_builder/
defload_data(source:str,batch_size:int=32,shuffle:bool=True)->DataLoader:"""
Load data from a source and return a DataLoader.
Args:
source: Path to data source or database connection string
batch_size: Number of samples per batch (default: 32)
shuffle: Whether to shuffle the data (default: True)
Returns:
DataLoader instance configured with the specified parameters
Raises:
FileNotFoundError: If source file doesn't exist
ConnectionError: If database connection fails
Example:
>>> loader = load_data("data/train.json", batch_size=64)
>>> for batch in loader:
... process_batch(batch)
"""pass
π Documentation
Building Documentation Locally
1
2
3
4
5
6
7
8
# Install Jekyll and dependencies
bundle install# Serve documentation locallycd docs
bundle exec jekyll serve
# View at http://localhost:4000/slm/
# Use pdb for debugging
importpdb;pdb.set_trace()# Or use ipdb (enhanced debugger)
importipdb;ipdb.set_trace()# Logging
importlogginglogging.basicConfig(level=logging.DEBUG)logger=logging.getLogger(__name__)logger.debug("Debug message")