question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Template for deploying any HuggingFace pipeline for supported tasks with Torchserve

See original GitHub issue

Hi! Lately I have been working on my repo that contains a template to deploy any Huggingface model supported by the pipeline, where pipeline is a simple-to-use abstraction provided by HF. The repo also includes copy-paste commands in READMEs for AWS EC2 instance.

Although I have only focused on deploying model with PyTorch backend as I would be adding scripts to deploy Torchscripted & LLM.Int8 pipeline models soon. Moreover, TF models present in an HF repo (example of an HF repo) can also be deployed by changing the framework attribute while initialising pipeline.

I have also tried to make the repo as beginner friendly as possible by including comments, references and compact code. There are also plans to integrate the HuggingFace optimum library that integrates elegantly with pipeline, so by extension, it would integrate well with my repo too with a few short scripts.

My repo could be useful to the open-source community and I believe it would reach a greater audience if added to the News section and/or examples/Huggingface_Transformers.

Thanks.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
msaroufimcommented, Aug 27, 2022

We can split the work into

  1. Add support for pipeline in existing handler code, refactor and simplify as needed
  2. Docker support for large models with its own sub folder
1reaction
msaroufimcommented, Aug 27, 2022

Ok that clarifies things, thank you. please feel free to make your PR directly. I think for now we can focus on improving the support for our HF models and once the PR is in we can work together to publicize the work. Please add @HamidShojanazeri and myself as reviewers for your PRs

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying huggingface's BERT to production with pytorch/serve
This story teaches you how to use it for huggingface/transformers models like BERT. Traditionally, serving pytorch models in production was ...
Read more >
Pipelines - Hugging Face
These pipelines are objects that abstract most of the complex code from the library, offering a simple API dedicated to several tasks, including...
Read more >
What is best way to serve huggingface model with API?
I have an shared an example using Torchserve (for the NER use-case) but it can be extended to other types by using different...
Read more >
About the Amazon SageMaker category - Hugging Face Forums
Are there any example nbs available for deploying? ... with the Amazon SageMaker native TorchServe integration | AWS Machine Learning Blog ...
Read more >
Tasks - Hugging Face
If your model is a transformers -based model, there is a 1:1 mapping between the Inference API task and a pipeline class. Here...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found