flair
flair copied to clipboard
AWS python Docker file
I'm currently attempting to upload an image using this Dockerfile, but I'm encountering an issue. Could someone please assist in resolving it or provide a Docker image? Docker file
# Use an official Python runtime as a parent image
FROM public.ecr.aws/lambda/python:3.9
# Set the working directory in the container
# WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
# Download Flair models
RUN python -c "from flair.models import SequenceTagger; SequenceTagger.load('ner-ontonotes-large')"
RUN python -c "from flair.models import SequenceTagger; SequenceTagger.load('pos-fast')"
RUN python -c "from flair.models import SequenceTagger; SequenceTagger.load('upos-fast')"
RUN python -c "from flair.models import SequenceTagger; SequenceTagger.load('chunk')"
# Copy your application files into the container
# COPY Flair ./Flair
# COPY Flair.py ./
# COPY main.py ./
COPY *.py ./
# Command to run the application
CMD ["main.lambda_handler"]
Hi @faisalriazgoraya
When asking for help, it is always usefull to put in all the information required. Right now I can do nothing, but ask you "what is the issue you are encountering?".
Also, when you are sharing any kind of code, please put them into a code block, by adding ````
before and after the text.
E.g.:
````
# this is a code block and will be formatted as such
same as this
````
vs
# this is a code block but will be displayed as a header
while this will be a normal line
# Use an official Python runtime as a parent image
FROM public.ecr.aws/lambda/python:3.9
# Set the working directory in the container
# WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
# Download Flair models
RUN python -c "from flair.models import SequenceTagger; SequenceTagger.load('ner-ontonotes-large')"
RUN python -c "from flair.models import SequenceTagger; SequenceTagger.load('pos-fast')"
RUN python -c "from flair.models import SequenceTagger; SequenceTagger.load('upos-fast')"
RUN python -c "from flair.models import SequenceTagger; SequenceTagger.load('chunk')"
# Copy your application files into the container
# COPY Flair ./Flair
# COPY Flair.py ./
# COPY main.py ./
COPY *.py ./
# Command to run the application
CMD ["main.lambda_handler"]
this is my docker file code and trying to use it uploading my code to AWS lambda Function and facing error
what error are you facing?
Post a screenshot of the errors