-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Custom Handler Example for BERT Model #267
Comments
Hi, I just created a medium post showcasing a simple custom handler for huggingface/transformers BERT: Thought I'd share it for reference, happy to help formalize it out for your documentation if you think that would be useful. |
Thank you! I think pushing this will be very helpful. We can bring this in under examples section. |
@mycpuorg Great, if I can help put it together - happy to. Just was not sure what dataset to use for the training script (same dataset as in the case of the standard text classifier?) and whether you would want one example to show general usage or multiple ones per use-case ( |
@maaquib @dhanainme Can you check if this can be closed. |
Hi, MFreidank, thank you for your sharing blog post https://medium.com/@freidankm_39840/deploy-huggingface-s-bert-to-production-with-pytorch-serve-27b068026d18. I follow your instructions and download bert-base-chinese.tar.gz in my directory transformer_model which contains bert_config.json, pytorch_model.bin, vocab.txt. Then I use the following steps to serve my model, but get "Backend worker monitoring thread interrupted or backend worker process died. Load model failed: my_tc, error: Worker died." error message. My custom_handler.py is almost the same as your transformers_classifier_torchserve_handler.py in your blog post, except that
in the initialize function. I can't load the pre-trained model successfully.
Is there some points to notice to save checkpoint model? Because as per your blog post, your model can serve successfully. |
BERT Models are not part of TorchServe's default handlers Given their popularity, it is worth while to add custom handlers showing the usage under examples.
The text was updated successfully, but these errors were encountered: