[Feature request] Using a single Torch binary for all the model related content
See original GitHub issue🚀 Feature Description
We consider using a single torch binary file as the model release format as opposed to the current zip files compressing all the other files used by a model at inference.
It’d help to keep things more compact and easy to manage by the ModelManager such as avoiding setting the relative paths of the dependencies (normalization stats, speaker IDs, etc.) in the config.json.
Solution
We’ll use a single model.pth
that includes all the data dependencies and the model itself. Then you can access the content as python attributes like
import torch
chkp = torch.load("model.pth.tar")
speaker_ids = chkp['speaker_ids']
speaker_encoder = chkp['speaker_encoder']
...
model = chkp['model]'
So let us know what you think about this proposed change under this issue.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Custom handler request data #529 - pytorch/serve - GitHub
I'm using curl POST upload two images, and running handle function in torch serve. I found POST requests cost a large part of...
Read more >Binary Classification Using New PyTorch Best Practices, Part 2
This is the second of two articles that explain how to create and use a PyTorch binary classifier. A good way to see...
Read more >Share a model - Hugging Face
In this tutorial, you will learn two methods for sharing a trained or fine-tuned model on the Model Hub: Programmatically push your files...
Read more >PyTorch Tutorial: How to Develop Deep Learning Models with ...
In this tutorial, you will discover a step-by-step guide to developing deep learning models in PyTorch. After completing this tutorial, you will ...
Read more >2. Troubleshooting Guide - PyTorch
Refer to this section for common issues faced while deploying your Pytorch models using Torchserve and their corresponding troubleshooting steps. Deployment and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@WeberJulian How about if we keep config.json separate?
Nothing stays inference only 😄. Also, it creates a decoupling that we need to manage, maintain and book. IMO a single format that works everywhere (train, inference, fine-tune) is a more convenient and reliable approach.
Yep only a .pth file (same file but we don’t use .tar any more)
Yes we 'll update all the models the same way