Comments (2)
Hi,
Just an update. Interestingly, I was able to run the following code from my local machine. So, it seems that there's a problem with Sagemaker Notebook Instance.
`
from sagemaker.huggingface import HuggingFaceModel
import boto3
iam_client = boto3.client('iam')
role = iam_client.get_role(RoleName='{IAM_ROLE_WITH_SAGEMAKER_PERMISSIONS}')['Role']['Arn']
hub = {
'HF_MODEL_ID':'distilbert-base-uncased-distilled-squad',
'HF_TASK':'question-answering' # NLP task you want to use for predictions
}
huggingface_model = HuggingFaceModel(
transformers_version='4.6.1',
pytorch_version='1.7.1',
py_version='py36',
env=hub,
role=role,
)
predictor = huggingface_model.deploy(
initial_instance_count=1, # number of instances
instance_type='ml.m5.xlarge' # ec2 instance type
)
input_data = {
"inputs": {
"question": "What is used for inference?",
"context": "My Name is Philipp and I live in Nuremberg. This model is used with sagemaker for inference."
}
}
predictor.predict(input_data)
`
Best,
Farshad
from notebooks.
Hi @farshadsm,
you might need to run pip install sagemaker --upgrade
on the SageMaker Notebook instance to work. I am not sure how regularly AWS is updating the kernels.
But I am happy you managed to solve it!
from notebooks.
Related Issues (20)
- Links to Colab notebooks are broken. HOT 1
- [text_classification.ipynb] Model initialized twice during hyperparameter search
- training, deploying sentence transformer model ( setfit method) in sagemaker pipeline HOT 2
- SAM iou_score is greater than 1?
- Incomplete Output from IDEFICS Inference Code HOT 1
- AttributeError: 'NoneType' object has no attribute 'get' while training HOT 2
- Pandas is required for the TAPAS tokenizer
- Separate model and inference script tar.gz not working.
- instruction finetuning IDEFICS
- Fine_tune_BLIP2_on_an_image_captioning_dataset_PEFT.ipynb loss is all NaN HOT 25
- Training SegFormer model not working (goes through notebook, but model loss becomes nan) on dataset I created (stuck for a week or so) HOT 5
- Informer/Transformer: multivariate forecasting with a panel of time-series
- Broken link in sagemaker notebook HOT 2
- SDXL_Dreambooth_LoRA_advanced_example.ipynb Training Issue
- FSDP training not loading saving the best checkpoint
- PatchTSTMixer fix HOT 4
- (TF)DistilBertForTokenClassification requires the 🤗 Datasets library
- Broken link in Load LoRAs for inference HOT 1
- RuntimeError expected scalar type Long but found Int in audio_classification.ipynb
- Incorrect variable name `tokenized_dataset` in Chapter 7 section 6 of course HOT 1
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 notebooks.