Skip to content

Frontend UI and task runner for mjai-reviewer, easily review with local mahjong AI (Mortal)

License

Notifications You must be signed in to change notification settings

hidacow/mjai-reviewer-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mjai-reviewer-ui

Frontend UI and task runner for mjai-reviewer, similar to mjai.ekyu.moe

Features

  • Automatically analyze and extract any format of input paipu, including

  • Detect 3-player or 4-player and run the corresponding version of mjai-reviewer

  • Auto detect target from the input or specify one

  • Select different engines(models), UI (classic or Killerducky), languages for reviewing

    Akochan is not supported

  • Task queue for concurrent users running multiple tasks

  • Cloudflare Turnstile Captcha support

  • Scheduler for cleaning up outputs and cached paipus

  • Queue size display in loading page

Get started

Install Requirements

pip install fastapi[standard] uvicorn[standard] aiohhttp

Set up dependencies

You need the following for this project to work

  • The reviewer binary from mjai-reviewer

  • The Mortal wrapper binary from Mortal

    • For reviewing 3-player games or using AkagiOT online model servers, you might need to modify some code in mortal by yourself

      You might need to Donate to the Akagi project for an api key to AkagiOT server

    • You also need the corresponding libriichi libraries for Mortal to work properly

      You might need to implement 3-player libriichi3p library yourself, or get one from the Akagi project through donation

  • A working config for each version of Mortal, including:

    • A trained model file
    • (optional) a GRP model file (you can remove the need of it by modifying some code in mortal)
  • (optional) tensoul server for downloading majsoul paipus

  • (optional) Turnstile sitekey and secret for captcha to protect your server from abuse

Write your own config

Create a file called config.py, you should refer to config.example.py and fill in the paths

Get Killerducky UI

Clone killer_mortal_gui into a directory called ui.

You might need my fork of killer_mortal_gui for supporting 3-player mahjong

Run the app

python app.py

or as background with custom listen address and output:

nohup uvicorn app:app --host 127.0.0.1 --port 5000 > app.log 2>&1 &

By default, the directory structure will be:

  • locks/for task locks
  • outputs/ for output htmls and json
  • paipus/ for downloaded paipus
  • ui/ killer_mortal_gui static files
  • app.py : main file
  • config.py : your config
  • index.html
  • loading.html

Credits

About

Frontend UI and task runner for mjai-reviewer, easily review with local mahjong AI (Mortal)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published