using pynini (or openFST) package in serverless lambda

0

Hello all, I'm trying to deploy a serverless lambda that uses pynini python library (it has an import statement of it). I added the package to the requirement/base file but the deploy keeps failing due to problems with fst installation. I tried to add the bin and lib files of the fst library as well, and add this statements:

os.environ['LD_LIBRARY_PATH'] = f"{os.environ['LD_LIBRARY_PATH']}:{os.environ['LAMBDA_TASK_ROOT']}/resources/fst/lib" os.environ['PATH'] = f"{os.environ['PATH']}:{os.environ['LAMBDA_TASK_ROOT']}/resources/fst/bin"

But it doesn't work as well. I get this error during deploy: extensions/_pywrapfst.cpp:815:10: fatal error: 'fst/util.h' file not found......Could not build wheels for pynini, which is required to install pyproject.toml-based projects

I have this headers files as well I just don't know how to tell the lanbda where they are... I would appreciate any help or ideas, thanks a lot

yael
질문됨 6달 전294회 조회
1개 답변
1

Hello,

Firstly in order to add "pynini" module in your Lambda fucntion, utilising 'Lambda containers' based on a 'non-AWS base image' is a recommended approach. To achieve this, you can create a Dockerfile that leverages a non-Amazon Linux machine and adds the necessary packages to it.

By opting for a non-AWS base image, you gain the flexibility to select any distribution base image. This choice proves valuable in addressing dependency issues associated with the "pynini" module.

For detailed guidance on creating a Lambda container-based function, please refer to the AWS documentation provided at the following link:

[+] https://docs.aws.amazon.com/lambda/latest/dg/python-image.html#python-image-clients

AWS
지원 엔지니어
답변함 6달 전
  • Thanks, i'll try that!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠