S3FileLoader downloads punkt and averaged_perceptron_tagger #12663
IamExperimenting
started this conversation in
General
Replies: 1 comment
-
I am getting same error with S3Fileloader. @IamExperimenting were you able to solve the issue. I also tried the below where I actually download the file first at /tmp location of a lambda which is not read only. I am trying to load a word document with open(f"/tmp/{tmp_file_name}", "rb") as f: I still get the error |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Team,
I’m trying to load text files from S3 bucket using AWS lambda function,
code :
from langchain.document_loaders import S3FileLoader
bucketname = “simple_bucket”
documentname = “textfiles/file1.txt”
document = S3FileLoader(bucketname, documentname).load()
textsplit = RecursiveCharacterTextSplitter()
docs = textsplit.split_documents(document)
here, in the below specific line, it downloads punkt and averaged_perceptron_tagger
“document = S3FileLoader(bucketname, documentname).load()”
As, I’m using lambda it throws me an error
OSError: [Errno 30] Read-only file system
when I debugged internally it tries to create a folder in lambda container, since “/home” is read only it doesn’t allow the code to create folder and download those
usually, I used to create folder in “/tmp/“ and download.
But here how do I mention the directory?
can someone guide me here?
Beta Was this translation helpful? Give feedback.
All reactions