default main cli to openai add data dict as a args
This commit is contained in:
@@ -20,7 +20,7 @@ async def main(args):
|
|||||||
|
|
||||||
print("Loading documents...")
|
print("Loading documents...")
|
||||||
documents = SimpleDirectoryReader(
|
documents = SimpleDirectoryReader(
|
||||||
"examples/data",
|
args.data_dir,
|
||||||
recursive=True,
|
recursive=True,
|
||||||
encoding="utf-8",
|
encoding="utf-8",
|
||||||
required_exts=[".pdf", ".txt", ".md"],
|
required_exts=[".pdf", ".txt", ".md"],
|
||||||
@@ -104,6 +104,12 @@ if __name__ == "__main__":
|
|||||||
default="./test_doc_files",
|
default="./test_doc_files",
|
||||||
help="Directory where the Leann index will be stored.",
|
help="Directory where the Leann index will be stored.",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--data-dir",
|
||||||
|
type=str,
|
||||||
|
default="examples/data",
|
||||||
|
help="Directory containing documents to index (PDF, TXT, MD files).",
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
asyncio.run(main(args))
|
asyncio.run(main(args))
|
||||||
|
|||||||
Reference in New Issue
Block a user