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.1.tar.gz (7.7 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.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rawformer-0.3.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","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.1.tar.gz
Algorithm Hash digest
SHA256 7fcd3270d09573ef814db665048f49154caba35111334b028afc75e8ea48cd56
MD5 15f5bc7da2a4f7cd602911840a048c12
BLAKE2b-256 b7d5e5b904467f9e8b3cc01ed670c136ce10eb4eaea2c912b8ad5778ed129011

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rawformer-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 069d6618a439dc9c09e87a23f0b33ef87a8b985aa7270570b4032f84e678a5c4
MD5 2901dc6c18537441afb8e939be65fae3
BLAKE2b-256 e788876e2236e9e976af63cf2e9b258885a9e86cc6d48a22a9b6beea835c4894

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