Jump to content

Recommended Posts

Posted (edited)

[Tool] Sugoi Offline Translator Repackage

The following are some repackages I did to strip down Sugoi Offline Translator v4.0 to only the barebones essentials but filled with as many features as possible from the available sources.

Disclaimers

  Reveal hidden contents

Sugoi Toolkit

  Reveal hidden contents

Repackage Description

  Reveal hidden contents

fairseq and CTranslate2

  Reveal hidden contents

PyTorch

  Reveal hidden contents

AMD graphics cards

  Reveal hidden contents

Microsoft DirectML

  Reveal hidden contents

HTTP servers available for fairseq/CTranslate2

  Reveal hidden contents

Notes on the repackages (Windows only)

  Reveal hidden contents

Converting to the CTranslate2 model format

  Reveal hidden contents

Pick one of the following.
- DL https://mega.nz/folder/ZORBTLAS#f2G4ih7crgWIN-_uSjbqAA
- The different repackage versions have
    - Support for the Sugoi v4.0 offline model.
    - Support for the fairseq and CTranslate2 inference libraries. This includes CPU, CUDA, and/or DirectML support.
    - Support for py3translationServer since their documentation is the most readable.
    - A preconfigured batch script to configure an isolated local environment.

Repackage Option A) Sugoi-Repackage-CUDA.7z
- Description - Normal and most flexible version recommended for most users. Supports both fairseq and CTranslate2 using both CPU and CUDA 11 or 12.
- Has a reasonable download+install time.
- Does not include PyTorch or the Sugoi model.
- Sugoi-Repackage-CUDA-Full.7z is the same as "Sugoi-Repackage-CUDA.7z", but comes bundled with PyTorch CUDA 11.8 and the other dependencies which bloats the compressed size from <100MB to ~2.48 GB. Since setup has been done already and it includes the both versions of the models.

Sugoi-Repackage-CUDA installation instructions

  Reveal hidden contents

Sugoi-Repackage-CUDA-Full installation instructions

  Reveal hidden contents

Repackage Option B) Sugoi-Repackage-CPU.7z
- Description - This version is for the bandwidth and GPU impaired that know they will only be using CPU inferencing. It supports only CTranslate2 + CPU.
    - If you know your GPU will not work with CUDA 11.x, then this is the best option.
- Has the fastest download+install time.
- Does not need PyTorch at all, thus saving lots of space and bandwidth!
- The model is not included.
- The model must be in CTranslate2 format.

Sugoi-Repackage-CPU Installation instructions:

  Reveal hidden contents

Repackage Option C) Sugoi-Repackage-DirectML.7z
- Description - This version is for gamblers who want to roll the dice with Microsoft DirectML on Windows 10 1903+.
- Read "DirectML" above and then use something else.
- Does not include PyTorch or the model.
- Do not expect anything to avoid the inevitable disapointment. Only sometimes works with fairseq ...for now.
- This PyTorch-DirectML repackage is provided as-is. No support is provided here if it does not work or breaks later.
- If it does not work, I do not care. If Microsoft does not care about supporting their library, then why should I?

Sugoi-Repackage-DirectML Install Guide:

  Reveal hidden contents

Repackage Option D) Sugoi-Repackage-Global
- Description - These are the same scripts as above but slightly tweaked to use the global git and Python interpreter. I have not tested these much.

  Reveal hidden contents

Sugoi Model Links

  Reveal hidden contents

Linux users

  Reveal hidden contents

Windows 7 and 8

  Reveal hidden contents

not so Frequently Asked Questions

  Reveal hidden contents

Licensing

  Reveal hidden contents

Edited by Entai2965
formatting, updated server links
Posted (edited)

Reserved.

Edit:

proof-of-concept.jpg

Notice that the translated text is in Spanish instead of English. Native Sugoi v4 only does Jpn->Eng.

So, I created a small demo/temporary server that translates to multiple languages. Its API is Sugoi compatible, so it should work will all existing software that says that it supports Sugoi which includes at least
- Sugoi Toolkit (the translate clipboard feature is pictured as an example above)
- the http://localhost:8501 streamlit web ui pictured above in the not so Frequently Asked Questions
- Textractor's Sugoi plugin
- That one Unity translation tool that supports a Sugoi plugin
- SLR Translator
- LunaTranslator

I intensely dislike this forums formatting options so I refuse to mirror the main documentation here. Just go read it on Codeberg instead.

Installation guide
0. If you are already using a Sugoi-Repackage, then skip to step 5.
1. Download one of the repackages. I recommend the Sugoi-Repackage-CPU since it is the smallest after installation
2. Extract it
3. Double click on Sugoi-Repackage.reproducible.bat
4. Wait for it to install
5. create a new text file where Sugoi-Repackage.reproducible.bat used to be called "Sugoi-Repackage\Sugoi-Repackage.multilingual.update.cmd" It needs to be in the same folder as the translationserver.ctranslate2.bat file that appears after the repackage is set up so that apps\ is a subfolder.
6. Copy this text into that file
7. save that file
8. double click on it and wait for it to update the server
9. it should create a file called multilingual_sugoi_compatible_server_ctranslate2.cmd, double click on it
10. test with sugoi somehow using one of the options listed above

To change the languages
1. If it is current working, close the two cmd_exe windows that popped up
2. Open multilingual_sugoi_compatible_server_ctranslate2.cmd and update the target language
- small100 language codes
- m2m100 language codes
- nllb-200 language codes
3. Double click on multilingual_sugoi_compatible_server_ctranslate2.cmd to launch the software
4. Test with a Sugoi compatible application again with any of the ways described above. that should produce multilingual output

Disclaimers
- The Sugoi compatible server is largely based on copying other people's code.
- I am not planning on adding more features to it, but will bug fix it if anyone discovers something broken.
- If you want features like cache, no memory usage on idle, and support for arbitrary transformers models, then go bother the original developer on github by creating a new issue, but I am not doing it.
- Everything here is open source and reasonably well documented. If you want to verify something is safe to run, just read the source code.

Edited by Entai2965
Reserved means I was using this post to test the horrible formatting buttons.
  • Entai2965 changed the title to [Tool] Sugoi Offline Translator Repackage

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...