Skip to content

Commit

Permalink
Deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
truskovskiyk committed Dec 1, 2024
1 parent f8fd8be commit ce22862
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ai-search-demo/ai_search_demo/qdrant_inexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,16 @@ def pdfs_to_hf_dataset(path_to_folder):
"page_text": text
})
global_index += 1
# Print memory usage after processing each image
current, peak = tracemalloc.get_traced_memory()
print(f"IMAGE: Current memory usage is {current / 10**6}MB; Peak was {peak / 10**6}MB")

# Print memory usage after processing each PDF
current, peak = tracemalloc.get_traced_memory()
print(f"Current memory usage is {current / 10**6}MB; Peak was {peak / 10**6}MB")
print(f"PDF: Current memory usage is {current / 10**6}MB; Peak was {peak / 10**6}MB")

current, peak = tracemalloc.get_traced_memory()
print(f"Current memory usage is {current / 10**6}MB; Peak was {peak / 10**6}MB")
print(f"TOTAL: Current memory usage is {current / 10**6}MB; Peak was {peak / 10**6}MB")
tracemalloc.stop() # Stop tracing memory allocations

print("Done processing")
Expand Down

0 comments on commit ce22862

Please sign in to comment.