user1112259
user1112259

Reputation:

Unable to get file meta data information in Llama index

I am unable to extract metadata information from the documents. PFB my code

filename_fn = lambda filename: {'file_name': filename}
documents = SimpleDirectoryReader("../data", file_metadata=filename_fn).load_data()
print([x for x in documents])

It's printing the empty array. I have a few documents in the data folder.

Upvotes: 1

Views: 1008

Answers (1)

Your code just works fine for me, maybe your folder path can cause this.

I am on llama_index -> 0.7.4

here

enter image description here

Upvotes: 0

Related Questions