Comments (3)
Make sure the transformers
version is updated. Old transformer version might not support that model.
from mlops-basics.
This runs the docker file right? In the DockerFile, I have used the same transformers
image as you have used, i.e : FROM huggingface/transformers-pytorch-cpu:latest
. Container gets built successfully when done locally and also in GitHub actions. But somehow it gives the above error when 'Test'ed in AWS Lambda
from mlops-basics.
When I used the week_8
docker image in the Lambda function and tested it, it worked. The image is the following one:
FROM amazon/aws-lambda-python
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
ARG MODEL_DIR=./models
RUN mkdir $MODEL_DIR
ENV TRANSFORMERS_CACHE=$MODEL_DIR \
TRANSFORMERS_VERBOSITY=error
ENV AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
RUN yum install git -y && yum -y install gcc-c++
COPY requirements_inference.txt requirements_inference.txt
RUN pip install -r requirements_inference.txt --no-cache-dir
COPY ./ ./
ENV PYTHONPATH "${PYTHONPATH}:./"
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN pip install "dvc[s3]"
# configuring remote server in dvc
RUN dvc init --no-scm
RUN dvc remote add -d model-store s3://models-dvc/trained_models/
# pulling the trained model
RUN dvc pull dvcfiles/trained_model.dvc
RUN python lambda_handler.py
RUN chmod -R 0755 $MODEL_DIR
CMD [ "lambda_handler.lambda_handler"]
I was getting error for the week_7
docker image in the Lambda function Test. The image was the following:
FROM huggingface/transformers-pytorch-cpu:latest
COPY ./ /app
WORKDIR /app
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
#this envs are experimental
ENV AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
# install requirements
RUN pip install "dvc[s3]"
RUN pip install -r requirements_inference.txt
# initialise dvc
RUN dvc init --no-scm
# configuring remote server in dvc
RUN dvc remote add -d model-store s3://models-dvc-viraj/trained_models/
RUN cat .dvc/config
# pulling the trained model
RUN dvc pull dvcfiles/trained_model.dvc
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
# running the application
EXPOSE 8000
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
from mlops-basics.
Related Issues (17)
- [Bug] Getting an error related to colorlog during the training HOT 2
- Is training happening? HOT 3
- Different module metrics for train/val HOT 2
- Advice how to deploy and run my docker image on my own local machine HOT 7
- Potential Error in Blog of Week 0 HOT 1
- Metric not matched between in `early_stopping_callbacks` (Week 1) HOT 1
- A question on week_0 HOT 5
- How to push a container to specific repository in GitHub Actions? HOT 2
- What is Postman? How to set it up? HOT 1
- Does it work on Windows? HOT 1
- Change Dimension of Softmax from 0 to 1 in modules from week 1 to 4
- Key error on Week1 HOT 2
- Cannot use `load_dataset('glue', 'cola')` in Week0 requirements.txt
- Error with numpy and transformers modules
- DVCFiles alternative not working
- Lambda Environent Support for SQLite3 Older Versions HOT 2
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 mlops-basics.