Git Product home page Git Product logo

omegat-pytorch-plugin's Introduction

OmegaT PyTorch plugin

Motivation

This repo serves to enable translators using OmegaT to add plugin support for TorchScript models. Currently it supports scripted fairseq models by way jFairseq.

Build

The plugin can be built using sbt clean assembly. Once this is done, the resulting artifact ./target/omegat-torchscript-plugin-1.0-SNAPSHOT-XYZ.jar will need to be moved to the OmegaT plugins directory where XYZ is the platform information of the target OmegaT installation.

Running OmegaT with the plugin

Because TorchScript support relies on native code a la libtorch, the OmegaT jar will need to be invoked with a java option indicating the location to the libtorch bundle:

% java -jar -Djava.library.path=$LIBTORCH_HOME /path/to/OmegaT.jar

where $LIBTORCH_HOME is /path/to/libtorch/lib/. Note: libtorch is platform-dependent, so be sure to download the appropriate libtorch for the operating system on which OmegaT will be running.

In addition, because of differences in native library loading on Windows, the path will need to be updated to include $LIBTORCH_HOME so all native dependencies can be located by library loader.

Currently Windows support is only ensured for PyTorch 1.7.1 nightlies as of 2 December 2020 and above, though non-Windows support is guaranteed for 1.5+.

Test

Tests can be run by issuing sbt test.

Authors

omegat-pytorch-plugin's People

Contributors

erip avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.