Skip to main content

RXN package for OpenNMT-related utilities

Actions tests

This repository contains OpenNMT-related utilities used in the RXN universe. For general utilities not related to OpenNMT, see our other repository rxn-utilities.

Links:

System Requirements

This package is supported on all operating systems. It has been tested on the following systems:

  • macOS: Big Sur (11.1)
  • Linux: Ubuntu 18.04.4

A Python version of 3.6, 3.7, or 3.8 is recommended. Python versions 3.9 and above are not expected to work due to compatibility with the selected version of OpenNMT.

Installation guide

The package can be installed from Pypi:

pip install rxn-onmt-utils

For local development, the package can be installed with:

pip install -e ".[dev]"

Package highlights

Translate with OpenNMT from Python code

By importing the following,

from rxn.onmt_utils import Translator, translate

you can do OpenNMT translations directly in Python. The translate function acts on input/output files, while the Translator class gives you flexibility for getting translation results on strings directly.

Stripping models

The script rxn-strip-opennmt-model installed the package allows you to strip ~2/3 of the size of model checkpoints by removing the state of the optimizer. You can do this safely if you don't need to continue training on these checkpoints.

Extending the model vocabulary

If you finetune a model on a dataset with additional tokens compared to the base model, you will need to extend the model weights. The script rxn-extend-model-with-vocab does that for you.

Metadata

Release files for rxn-onmt-utils 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rxn-onmt-utils 1.1.0
File Size Uploaded
rxn-onmt-utils-1.1.0.tar.gz 15.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rxn-onmt-utils 1.1.0
File Interpreter ABI Platform
rxn_onmt_utils-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.4 kB

Release files / rxn-onmt-utils-1.1.0.tar.gz

Download URL rxn-onmt-utils-1.1.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
76f8d4a94e521ff7d04a2a0b8055da32fdd39f33ff210cb62792669a755e2ba3
BLAKE2b-256 checksum
How to use checksums
2416aadae28f8295329cea999557b58ae6d7d7d24d90de21304b0ea2c86a3a4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / rxn_onmt_utils-1.1.0-py3-none-any.whl

Download URL rxn_onmt_utils-1.1.0-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08243dc198c6e2693882c6a2c31f5dfc4f537e4eb7a8978f6f90c09cf800cf22
BLAKE2b-256 checksum
How to use checksums
81f0891fbf009ec737cb6088e4e11b574bae69a14cbf9c46dd1d7af64dae3ed1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page