Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

GameTranslate

Immersive real-time translator at your disposal 路 By Godnoken

[GUIDE] Japanese <-> English LLAMA Sticky

A topic by Godnoken created 61 days ago Views: 484 Replies: 4
Viewing posts 1 to 3
Developer (3 edits)

Guide to use a bidirectional Japanese <-> English LLAMA supported model

Since the demand for Japanese translations is massive in comparison to other languages, I figured it is due time that I provide a short guide on how to translate offline with a better (but slower) translation model using LLAMA.

1. Download a model from the right-hand side of this model board or directly download the Q4_K_M model (229mb) or the Q8_O model (379MB)


2. Select LLAMA translator in the GameTranslate app


3. Import the downloaded .gguf model file


4. Put Japanese or English for source and vice versa for target, and select Full language name box


5. Tick the 'Custom Body' box



6. Copy this JSON block and paste it straight into the body

{

    "prompt": "<|startoftext|><|im_start|>system\nTranslate to %target%.<|im_end|>\n<|im_start|>user\n%text%<|im_end|>\n<|im_start|>assistant\n",

    "max_gen_len": 64,

    "temperature": 0.5,

    "top_p": 1,

    "min_p": 0.1,

    "repetition_penalty": 1.05

}



7. You're done! Feel free to try it out in the translation test


If your intention is to read Japanese Manga (Right to left, Vertical text), keep reading!

To adapt the application for reading Japanese Manga, you will want to change a few more settings;

1. Select Right to left reading direction & Vertical Writing orientation in the OCR tab


2. Check the 'Comic mode' and 'Scroll reset behaviour' checkboxes in the General tab


For this guide to work pain-free, please make sure you do not have any 'Manual selection' checkbox checked

That's it for this short guide. Please let me know if you have any issues using the LLAMA model in any way, and do not be shy to request guides for other languages! Enjoy! :)

Thanks for this guide! I ran a bunch of tests and can give some results, maybe it'll help others here too.

I experimented with the test text input (nice function, I didn't notice it there before!) and tossed a bunch of somewhat-tricky Japanese proverbs at both of the  two models you recommended. I seemed to have both the most accurate generations with the Q4_K_M model, which took 3-4 seconds to work; Q8_O model was faster by like a second but also notably-worse. I attached both models to a Japanese game I was running and got similar results to the tests, so Q4 just seems superior and doesn't at all intensive even for my average-power computer.

Dumping screengrabs of the game and putting it into Google Translate is still a little more accurate than Q4, but Google Translate is also way more of a hassle and notably slower with alt-tabbing required. Q4 is certainly getting the job done and being accurate enough to play a game comfortably I would say. (I tested with a Japanese RPG and got a lot of varying NPCs to test with, and I got the idea of everything everyone was saying. I threw their words into Google Translate too and it was the same information, sometimes a bit more accurate but either way, it works.)

Notably and surprisingly to me: One thing Q4 did better than Google Translate at (and this is likely a credit to the image-recognition you put into GameTranslate too) was translating fancy, tilted text. The RPG in question that I was testing with tilts all character names at the top of their oddly-shaped dialogue boxes; Google called one NPC 'Penguin Hote Clerk' while Q4 more-correctly read the text as 'A Penguin Hotel Employee'.

If you have any other suggestions, I think I'd personally be interested in another more-intensive and more-accurate model than Q4, seeing that Q4 doesn't seem to push my system that much at all. (But I'm also happy sticking to Q4 for now too.)

Developer

The Q4_K_M model should be faster and lower quality, so these results are very surprising! Must be something wrong with it.
I'm glad the model is proving good enough for your use case, that's excellent news. Quality offline translation for the privacy-concerned is great :)

For this specific model, you could try the F32 (1.42GB) and F16 (711MB). I think both likely will be too slow for you, but seeing as the Q8_M model seems broken, I'd try F16 first. Maybe even try the Q6_K.

There are other models out there, but I haven't had time to try any other EN-JP models. Not sure if there are any better ones.

Thank you for testing it out, much appreciated feedback!

How strange! I kept both recommended models around in case I feel like further testing... But yeah, strange. Perhaps I should run both against a larger group of games eventually.

Thanks for the additional suggestions, I'll play with those three later too then~

Woo ! guides ! 馃檶
(I don鈥檛 use this translation pathway still hyped for all the people who do/will) 鉂わ笍