Can't Add Ml backend in label-studio

Viewed 1299

I am trying to add my ML model on label studio. I have tried these commands

cd label-studio
pip install -e .
cd label_studio/ml/examples
pip install -r requirements.txt


   label-studio-ml init my_ml_backend --script label_studio/ml/examples/simple_text_classifier.py

These are the files in label_studio/ml/examples:- requirements.txt

simple_text_classifier.py

dummy_model.py

pytorch_transfer_learning.py

It's giving me this error:

ModuleNotFoundError: No module named 'simple_text_classifier'

How can I add my model on label studio?

2 Answers

Probably a little late, but maybe someone else finds this question. What did the trick for me: while in the label_studio/ml/examples folder, try

label-studio-ml init my_ml_backend --script simple_text_classifier.py

(I simply removed the rest of the parth from the script) If you get an error telling you to add --force, do either that (which will override the existing my_ml_backend folder) or simply delete the my_ml_backend folder and run the same command again.

After that, you hopefully should get the following response:

Congratulations! ML Backend has been successfully initialized in ./my_ml_backend
Now start it by using:
label-studio-ml start ./my_ml_backend

The quick solution that worked for me is that I navigated (cd) to the directory containing simple_text_classifier.py i.e. examples, and then from that directory executed the command:

label-studio-ml init my_ml_backend --script simple_text_classifier.py

Related