0

I ran the following commands
torch-model-archiver --model-name "bert" --version 1.0 --serialized-file ./bert_model/pytorch_model.bin --extra-files "./bert_model/config.json,./bert_model/vocab.txt" --handler "./handler.py"

I created all the files and then I created a new directory and copied the model into it.

Then I executed the following command:

torchserve --start --model-store model_store --models bert=bert.mar

It then displayed a slew of errors.

Here is my error text. It is too long and repetitive; hence, I posted it on paste bin.

error

1
  • This is the repository which I am trying to run the code from Commented Dec 17, 2022 at 7:42

1 Answer 1

0

I would suggest lowering down the number of workers per model (Default workers per model: 12) now you get the maximum number that your can handle

How? Go to config.properties file and add (the first line indicates the workers to 2):

 default_workers_per_model=2

Then when you will do the torchserve add this (ts-config option to point on the location of you config.properties file):

torchserve  --start \
            --model-store  ./deployment/model-store \
            --ts-config ./deployment/config.properties \
            --models bert=bert.mar

Let me know if this solves the error.

Note : you can add other parameters as well in the config.properties file such as :

inference_address=http://0.0.0.0:8080
management_address=http://0.0.0.0:8081
metrics_address=http://0.0.0.0:8082
default_workers_per_model=2
number_of_netty_threads=1
netty_client_threads=1
prefer_direct_buffer=true
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.