Comments (7)
Thats because your structure is not correct. It need to be
model.tar.gz
code/
inference.py
config.json
tf_model.h5
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.txt
You can take a look here
from sagemaker-huggingface-inference-toolkit.
ok nice! we should write that in the doc no? to have all model artifacts directly in the archive without folder hierarchy
from sagemaker-huggingface-inference-toolkit.
It is actually documented here.
But I agree with you since you already into trouble we should make it more clear.
The Hugging Face Inference Toolkit allows user to override the default methods of the HuggingFaceHandlerService. Therefor the need to create a named code/ with a inference.py file in it. For example:
model.tar.gz/
|- pytroch_model.bin
|- ....
|- code/
|- inference.py
|- requirements.txt
In this example, pytroch_model.bin is the model file saved from training, inference.py is the custom inference module, and requirements.txt is a requirements file to add additional dependencies. The custom module can override the following methods:
from sagemaker-huggingface-inference-toolkit.
yes, what I meant is that the doc didn't say "don't create folders, have every file in the archive without any folder" right?
from sagemaker-huggingface-inference-toolkit.
added this to the documentation.
Model artificat structure model.tar.gz
The model.tar.gz
contains all required files to run your model including your model file either pytorch_model.bin
, tf_model.h5
, tokenizer.json
, tokenizer_config.json
etc. All model artifacts need to be directly in the archive without folder hierarchy.
examples for PyTorch:
model.tar.gz/
|- pytroch_model.bin
|- vocab.txt
|- tokenizer_config.json
|- config.json
|- special_tokens_map.json
from sagemaker-huggingface-inference-toolkit.
nice! but we agree that with custom model_fn
the archive structure can be anything right? people would be responsible to write code that can parse it
from sagemaker-huggingface-inference-toolkit.
Yes
from sagemaker-huggingface-inference-toolkit.
Related Issues (20)
- Using custom inference script and models from Hub HOT 1
- get_pipeline function passes Path object rather than PretrainedTokenizer
- No support for multi-GPU HOT 2
- 🏷️ invalid
- Sagemaker endpoint inferencing error with HF model loading from s3bucket with new transformer update HOT 5
- Support multiple return sequences
- Make `DEFAULT_HF_HUB_MODEL_EXPORT_DIRECTORY` configurable through environment variable HOT 1
- InternalServerException while deploying HuggingFace model on SageMaker HOT 6
- Data format for inference HOT 1
- Support passing model_kwargs to pipeline HOT 1
- InternalServerException at runtime HOT 3
- trust_remote_code=True in new Hugging Face LLM Inference Container for Amazon SageMaker HOT 2
- How to access CustomAttributes in async inferece request input_fn HOT 1
- [DOCS] List of available HF_TASK and default inference scripts HOT 4
- Dead Link for Available HF_Tasks HOT 1
- SageMaker deployment errors HOT 2
- Error on Sagemaker deployment for v1.0.1 HOT 1
- How can I delpoy a model with AWS S3 and without downloading model from hunggingface via TGI image on Sagemaker? HOT 2
- How to enable Batch inference on AWS deployed Serverless model from Hub? HOT 1
- Where is the logic for detecting custom inference.py? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sagemaker-huggingface-inference-toolkit.