fix cli if there is no other type of doc to make it robust

This commit is contained in:
yichuan520030910320 committed 2025-08-07 18:46:05 -07:00
1 parent c96d653072
commit 710e83b1fd
1 file changed
+7
+7
View File
@@ -356,6 +356,8 @@ Examples:
".py",
".jl",
]
# Try to load other file types, but don't fail if none are found
try:
other_docs = SimpleDirectoryReader(
docs_dir,
recursive=True,
@@ -363,6 +365,11 @@ Examples:
required_exts=code_extensions,
).load_data(show_progress=True)
documents.extend(other_docs)
except ValueError as e:
if "No files found" in str(e):
print("No additional files found for other supported types.")
else:
raise e
all_texts = []
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.