Find answers from the community

Updated 3 months ago

I have deployed python based llamaindex

I have deployed python based llamaindex in aws lambda to act as backend for slack bot. The lambda init is timing out beyond 10 sec which retrigger the message from slack.

I suspect that this is due to "[nltk_data] Downloading package punkt to /tmp/llama_index."

Is there a way to package the model as part of docker build process and tell llama_index to use it instead of downloading it ?
W
A
4 comments
One way is to send back the ack() to slack. This will stop retriggering.
Sample code would look like
Plain Text
@slack_app.event("message")
async def handle_slack_message(client, event, ack, say):
    try:
        ack()
        .... # Do rest of the process
As I dont think downloadingpunkt take a lot of time.
I am already using SlackRequestHandler which implements lazy processing of the messages by giving the ack within 3 sec
along with app = App(process_before_response=True)
Add a reply
Sign up and join the conversation on Discord