Skip to content

Commit

Permalink
add tqdm to show upload progress
Browse files Browse the repository at this point in the history
  • Loading branch information
leehuwuj committed Dec 3, 2024
1 parent 661f13d commit 05c2d53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions templates/components/vectordbs/python/llamacloud/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import logging

from llama_index.core.readers import SimpleDirectoryReader
from tqdm import tqdm

from app.engine.index import get_index
from app.engine.service import LLamaCloudFileService # type: ignore
Expand All @@ -32,9 +33,13 @@ def generate_datasource():
files_to_process = reader.input_files

# add each file to the LlamaCloud pipeline
for input_file in files_to_process:
for input_file in tqdm(
files_to_process,
desc="Processing files",
unit="file",
):
with open(input_file, "rb") as f:
logger.info(
logger.debug(
f"Adding file {input_file} to pipeline {index.name} in project {index.project_name}"
)
LLamaCloudFileService.add_file_to_pipeline(
Expand Down

0 comments on commit 05c2d53

Please sign in to comment.