Skip to main content

Transformers from scratch

Project description

rawformer

Transformers from scratch.

This library implements transformer architectures from pure PyTorch. It's not production ready, more so for my personal use and understanding.

Supported architectures:

  • ViT

Supported positional encodings:

  • Learned
  • RoPE (1D and 2D)

Installation

pip install rawformer

This library uses runtime checks to validate itself and throw better error messages early. NOTE: Beartype is incompatible with torch.compile.

  • Turn off runtime type checking with env var: BEARTYPE=0
  • Turn off python interpreter's assert statements with env var: PYTHONOPTIMIZE=1

Developer install

uv sync --extra cpu
uv sync --extra cuda

pre-commit install
pre-commit run --all-files

uv pip install -e .

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

rawformer-0.3.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

rawformer-0.3.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file rawformer-0.3.0.tar.gz.

File metadata

  • Download URL: rawformer-0.3.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rawformer-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9e5159d7dc4d8fe78279759e621089fa4a06ccf6ac1bc506ae5fcb6bb0c8c702
MD5 10323a3ca5a614ab79a1dc93dddd6031
BLAKE2b-256 90dac4e9f36681d0b1c945ac60cc2412740475a24e2997525046cb46ed6fa970

See more details on using hashes here.

File details

Details for the file rawformer-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: rawformer-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rawformer-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abdacb08ed70f4112ae8f1d10c805272b34ae324d468b852a3f8e0de03ca70b1
MD5 81e35fef66e917aa407adedc3542699c
BLAKE2b-256 9fb73f4f55b647b7e50e69d9a5e8c36891f516c6965e236392af5f5ec62320eb

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