Skip to main content

A collection of machine learning utilities

Project description

ml

A collection of machine learning utilities.

Installation

pip install ml

A collection of utilities for ML/NLP research.

Utilities

ml.snapshot

Isolate experiment code on shared / networked filesystems (e.g. Slurm) by copying the current directory into a per-experiment snapshot and running a command inside the copy. Editing your source afterwards won't affect queued or in-flight jobs.

As a library (standard library only):

from ml.snapshot import snapshot

snapshot_dir = snapshot(
    "python train.py",
    exclude=["*.log", "wandb"],
    experiment_id="42",
)

As a CLI (requires the cli extra: pip install 'ml[cli]'):

ml-snapshot --experiment-id 42 --exclude '*.log' 'python train.py'

The base directory defaults to $SNAPSHOT_DIR (or snapshotted_experiments), and exclude patterns fall back to the comma-separated $SNAPSHOT_EXCLUDE.

Development

This project uses uv for dependency management.

# Install dependencies (including dev tools)
uv sync

# Run the test suite
uv run pytest

# Lint and format
uv run ruff check .
uv run ruff format .

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ml-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ml-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file ml-0.1.0.tar.gz.

File metadata

  • Download URL: ml-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for ml-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4a8303c8f270490dd11b00599eb6e6bc1ef35f73bcea347672c2223a0276c6d8
MD5 cc9fb17d7a11d7ecc9f4770c4cadf27c
BLAKE2b-256 2da4b2f10f1fc6daef1a98fef8283c6654964048ec5d0dc96a0dd31003893292

See more details on using hashes here.

File details

Details for the file ml-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ml-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for ml-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72308a272f0679f1b289edb3746692dbaabfd16b76873ceddb8761f91418fa49
MD5 e8f4aeac2dbd5f04830ebb351d1b9605
BLAKE2b-256 5a09eb5a4e3e6ffa652159574a3258eff33ee4a655712d1aabec586903137ed0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page