Find answers from the community

s
F
Y
a
P
Updated last month

**MarkdownReader broken?**

Solved (thanks !):
You have to instantiate the readers.

Correct: ".md": MarkdownReader(),

Incorrect:".md": MarkdownReader,

MarkdownReader broken?

When I try to use my own set of file_extractors, I get the following error:
Plain Text
Failed to load file /app/data/manual.md with error: MarkdownReader.load_data() missing 1 required positional argument: 'file'. Skipping...

Code:
Plain Text
file_extractor = {
    ".csv": PandasCSVReader,
    ".docx": DocxReader,
    ...
}
SimpleDirectoryReader(
    input_dir=self.knowledge_path,
    file_extractor=file_extractor,
).load_data()

But this goes away if I just use default extractors. Any ideas?
j
L
5 comments
Plain Text
poetry show llama-index-readers-file
 name         : llama-index-readers-file
 version      : 0.1.33


Plain Text
poetry show llama-index
 name         : llama-index
 version      : 0.10.65
I'm pretty sure you are meant to be instansiating the readers
".md": MarkdownReader(), for example
@Logan M that's it! thank you. i was looking at default_file_reader_cls in core/readers/file/base.py and got confused because it just uses the classnames there
yea a tad confusing πŸ˜… I think it goes an initializes the defaults at some point
Add a reply
Sign up and join the conversation on Discord