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.2.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.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rawformer-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 b504c7f9d55a256cadcbfe7a3930bcb4c7435d1f10a132206c394ac7f882a9a2
MD5 b69b21c538a2b4fea8813cfdbbb6f999
BLAKE2b-256 27a013c62639068e2dd371b641a7541e65956d4233bba3007288bd24e27a61d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rawformer-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d135d9ba167863297c65d92c80d5725aebfffe1fe6def3fe4116ab51ba314246
MD5 f5fd481016ac5640a849677dba9cf900
BLAKE2b-256 cf2e7f83633f40ca521fd8e0af9787a38e77eef3245ef9160071371bfd064bcb

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