Skip to content

Commit

Permalink
shallow clone to speed up
Browse files Browse the repository at this point in the history
  • Loading branch information
lionello committed Nov 10, 2024
1 parent 9c2e10c commit 4a4fd67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/get_knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def clone_repository(repo_url, local_dir):
""" Clone or pull the repository based on its existence. """
if not os.path.exists(local_dir):
print(f"Cloning repository into {local_dir}")
Repo.clone_from(repo_url, local_dir)
Repo.clone_from(repo_url, local_dir, depth=1)
else:
print(f"Repository already exists at {local_dir}. Pulling latest changes...")
repo = Repo(local_dir)
Expand Down Expand Up @@ -137,7 +137,7 @@ def parse_markdown_file_to_json(file_path):
for section in sections:
about = ", ".join(section["about"])
text = " ".join(line for line in section["text"] if line)

if about and text: # Only insert if both 'about' and 'text' are not empty
json_output.append({
"id": current_id,
Expand Down

0 comments on commit 4a4fd67

Please sign in to comment.