Pantogloss
Pantogloss is a TensorFlow/Keras many-to-English machine-translation library.
Its first model, pantogloss-500-en, was converted and numerically validated
from the model described in Many-to-English Machine Translation
Tools, Data, and Pretrained Models (ACL-IJCNLP 2021).
The Python package is distributed through PyPI, while the initial model is kept
in a separate private Hugging Face repository. Installing Pantogloss does not
grant model access; users must be authorized for
chrismattmann/pantogloss-500-en and authenticate with hf auth login.
The codebase and converted model are licensed under Apache-2.0. This repository is private during initial development.
Intended API
from pantogloss import Translator
translator = Translator.from_pretrained("pantogloss-500-en")
print(translator.translate("Comment allez-vous ?"))
RTG-compatible beam search is available without changing the return type:
print(
translator.translate(
"Comment allez-vous ?",
beam_size=4,
length_penalty=0.6,
)
)
Pantogloss selects the first TensorFlow GPU automatically and enables memory growth. Device choice can also be made explicit:
translator = Translator.from_pretrained("pantogloss-500-en", device="gpu")
print(translator.device_info)
Using device="gpu" fails clearly if TensorFlow cannot see a GPU; use
device="cpu" to force CPU inference.
Install the accelerator backend for the machine:
# Linux with an NVIDIA GPU
pip install 'pantogloss[cuda]'
# Apple Silicon
pip install 'pantogloss[metal]'
Both use the same device="auto" or device="gpu" Python API. The CUDA extra
does not install or replace the host NVIDIA driver. The Metal extra uses Apple's
TensorFlow PluggableDevice and the TensorFlow 2.18 runtime combination validated
by the Bytewise project.
The model is stored separately in the private Hugging Face repository
chrismattmann/pantogloss-500-en; it is never included in the Python wheel.
Development status
The complete 307-variable Keras model has been converted locally from all 308 learned PyTorch tensors (the target embedding and output projection are tied). Greedy parity against the archived RTG implementation passes across a ten-language batch: token IDs and translations match exactly, while final logits have a maximum absolute error of 1.24e-5. With the original beam size 4 and length penalty 0.6, all decoded four-best candidate sets match. One near-tied example changes top rank because of framework floating-point ordering. Model version 0.1.0 is released in the private Hugging Face repository at an immutable commit.
The source model and generated artifacts stay under the ignored artifacts/
directory. To reproduce conversion after acquiring the source archive:
python tools/convert_rtg_checkpoint.py \
artifacts/source/rtg500eng-tfm9L6L768d-bsz720k-stp200k-ens05 \
artifacts/converted/pantogloss-500-en-candidate
Run the reference parity harness with:
CUDA_VISIBLE_DEVICES=-1 python tools/check_parity.py \
artifacts/source/rtg500eng-tfm9L6L768d-bsz720k-stp200k-ens05 \
artifacts/converted/pantogloss-500-en-candidate
To require and verify real GPU placement:
python tools/check_gpu.py artifacts/converted/pantogloss-500-en-candidate
Apple Silicon validation
Pantogloss uses the same hardware-neutral GPU API for CUDA and Metal. On an M-series Mac with Python 3.12 and Xcode command-line tools installed:
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e '.[metal,test]'
hf auth login
python tools/check_platform.py --device cpu
python tools/check_platform.py --device gpu
python tools/benchmark_inference.py --device gpu --runs 5
The portable platform report identifies the selected backend as cpu, cuda,
or metal, verifies the first model variable's actual TensorFlow placement,
and runs a real translation. Metal placement and inference are validated on an
Apple M3 Max with TensorFlow 2.18.1. For a short batch-one sentence, its warmed
median was 0.545 seconds on CPU and 0.633 seconds on Metal; accelerator benefits
are expected primarily from batching and future compiled decoding.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pantogloss-0.1.0.tar.gz.
File metadata
- Download URL: pantogloss-0.1.0.tar.gz
- Upload date:
- Size: 27.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
007cc1f0e22860ee25dbf9e1d7dca966a57c6beb8da2a5fcacb6a86d30c51584
|
|
| MD5 |
9ede784ca0e04293935b4e10059ace2f
|
|
| BLAKE2b-256 |
994d305b6528e9d1f5434d8a2c3b89f205dd8f15014b24634620d7b62ede6f78
|
Provenance
The following attestation bundles were made for pantogloss-0.1.0.tar.gz:
Publisher:
release.yml on chrismattmann/pantogloss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pantogloss-0.1.0.tar.gz -
Subject digest:
007cc1f0e22860ee25dbf9e1d7dca966a57c6beb8da2a5fcacb6a86d30c51584 - Sigstore transparency entry: 2522119006
- Sigstore integration time:
-
Permalink:
chrismattmann/pantogloss@9f04e14958eb7baeb41479846dda892eb547f747 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/chrismattmann
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9f04e14958eb7baeb41479846dda892eb547f747 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pantogloss-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pantogloss-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b512a74e75127f6426391fe04084b471ee2ff906f9bc21648e5bd586cab04969
|
|
| MD5 |
263abf3598b7eb4faa7e07fd26ffbef1
|
|
| BLAKE2b-256 |
430a1f6b04d6e9c93ac6499270f3306f2527da7b2d4768f9153ed73ff39f5a4b
|
Provenance
The following attestation bundles were made for pantogloss-0.1.0-py3-none-any.whl:
Publisher:
release.yml on chrismattmann/pantogloss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pantogloss-0.1.0-py3-none-any.whl -
Subject digest:
b512a74e75127f6426391fe04084b471ee2ff906f9bc21648e5bd586cab04969 - Sigstore transparency entry: 2522119572
- Sigstore integration time:
-
Permalink:
chrismattmann/pantogloss@9f04e14958eb7baeb41479846dda892eb547f747 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/chrismattmann
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9f04e14958eb7baeb41479846dda892eb547f747 -
Trigger Event:
release
-
Statement type: