Trying a python program, using hugging face transformers & faiss. I was able to use the API successfully while testing locally. But while testing the same inside docker, the api executes successfully the first time & the I get a Error : Socket hang up when trying via postman. Post which the docker exits.
What I have tried so far:
- Adding ‘/’ at the end of the URL
- Adding host = ‘0.0.0.0’
- Trying torch version == 1.11.0
- Changed Postman timeout settings & Max response size & Unchecked ‘Send Postman token header’
- Tried the API using Thunder Client & cURL.
Docker File :
FROM python:3.8.0
COPY . .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
RUN python3 -m spacy download en_core_web_sm
CMD [ "python3", "-m" , "flask", "run", "--host", "0.0.0.0", "--port=8002"]
EXPOSE 8002