-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: llamaindex-cli missing glob pattern? #11798
Comments
Hey @hemanth! 👋 Great to see you back here. Hope you've been doing well! Thank you for reporting this issue. Based on the information you've provided and the context I have, it seems like the In the if files is not None:
documents = []
for _file in iglob(files, recursive=True):
_file = os.path.abspath(_file)
if os.path.isdir(_file):
reader = SimpleDirectoryReader(
input_dir=_file,
filename_as_id=True,
file_extractor=self.file_extractor,
)
else:
reader = SimpleDirectoryReader(
input_files=[_file],
filename_as_id=True,
file_extractor=self.file_extractor,
)
documents.extend(reader.load_data(show_progress=verbose)) The I also found a similar closed issue [Bug]: llamaindex-cli unrecognized arguments: - files ./README.md which suggests using the correct command-line argument for files, which is Unfortunately, I couldn't find any changes in the Could you please provide more information about your environment? Specifically, the operating system and its version, the shell you're using, and the exact command you're running? This will help us better understand the issue and find a solution. Sources
|
@logan-markewich I wold like pair on fixing this :) |
This change modifies the llamaindex-cli such that it can handle the --files argument to properly handle glob patterns. In order to handle globs like the example given in the issue, the number of arguments (nargs) value must be set to + in order to return a list of files or patterns in this case. Because argparse now returns a list, so restructuring on how the files are processed needed to be changed along with the signature of the function. Fixes run-llama#11798 Signed-off-by: Eric Brown <[email protected]>
This change modifies the llamaindex-cli such that it can handle the --files argument to properly handle glob patterns. In order to handle globs like the example given in the issue, the number of arguments (nargs) value must be set to + in order to return a list of files or patterns in this case. Because argparse now returns a list, so restructuring on how the files are processed needed to be changed along with the signature of the function. Fixes run-llama#11798 Signed-off-by: Eric Brown <[email protected]>
This change modifies the llamaindex-cli such that it can handle the --files argument to properly handle glob patterns. In order to handle globs like the example given in the issue, the number of arguments (nargs) value must be set to + in order to return a list of files or patterns in this case. Because argparse now returns a list, so restructuring on how the files are processed needed to be changed along with the signature of the function. Fixes run-llama#11798 Signed-off-by: Eric Brown <[email protected]>
Bug Description
llamaindex-cli rag --files
isn't accepting glob patterns.Version
0.0.7
Steps to Reproduce
Relevant Logs/Tracbacks
No response
The text was updated successfully, but these errors were encountered: