jsphweid / mt3-docker

Magenta's MT3 Model extracted from a colab notebook into a docker container served up with Flask
5 stars 0 forks source link
magenta mt3

mt3-docker

Useful if you want to run the MT3 model on your ubuntu dual-boot gaming rig instead of a colab notebook.

Thanks to the Magenta team for this amazing model.

NOTE: this Dockerfile assumes you:

  1. have a host machine with an eligible GPU
  2. compatible versions of cuda toolkit and nvidia drivers installed - Dockerfile uses nvidia/cuda:11.7.0
  3. cudnn installed

NOTE: I'm not an expert here and there may be steps here or steps in the Dockerfile that are not necessary. Feel free to make an MR if you see something excessive or incorrect!

Usage

Once machine is setup properly (see above about setting up GPU), then just build and run the image...

sudo docker build -t mt3 .
sudo docker run -p 5000:5000 --gpus all mt3 # NOTE: you may need to adjust memory i.e. "-m 12000m"

Once that's running, you can simply issue a POST request to http://<container-ip>:5000/transcribe-anything (or http://<container-ip>:5000/transcribe-piano) with POST data like {"data": "<base64file16ksamplerate>"}

Using a 3090 it should take less than a minute for most music files.

TODO

Dockerfile is really messy.