Cleaned up unnecessary logging

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
This commit is contained in:
Maksym Lysak 2025-02-12 17:56:37 +01:00
parent 55fa4eb4e3
commit e486eb1720
2 changed files with 5 additions and 17 deletions

View File

@ -81,11 +81,6 @@ class SmolDoclingModel(BasePageModel):
if hi_res_image is not None: if hi_res_image is not None:
im_width, im_height = hi_res_image.size im_width, im_height = hi_res_image.size
print(
"Processed image resolution: {} x {}".format(
im_width, im_height
)
)
# populate page_tags with predicted doc tags # populate page_tags with predicted doc tags
page_tags = "" page_tags = ""
@ -115,7 +110,6 @@ class SmolDoclingModel(BasePageModel):
) )
inputs = {k: v.to(self.device) for k, v in inputs.items()} inputs = {k: v.to(self.device) for k, v in inputs.items()}
print("In the model, starting to generate...")
start_time = time.time() start_time = time.time()
# Call model to generate: # Call model to generate:
generated_ids = self.vlm_model.generate( generated_ids = self.vlm_model.generate(
@ -138,11 +132,11 @@ class SmolDoclingModel(BasePageModel):
inference_time = time.time() - start_time inference_time = time.time() - start_time
tokens_per_second = num_tokens / generation_time tokens_per_second = num_tokens / generation_time
print("") # print("")
print(f"Page Inference Time: {inference_time:.2f} seconds") # print(f"Page Inference Time: {inference_time:.2f} seconds")
print(f"Total tokens on page: {num_tokens:.2f}") # print(f"Total tokens on page: {num_tokens:.2f}")
print(f"Tokens/sec: {tokens_per_second:.2f}") # print(f"Tokens/sec: {tokens_per_second:.2f}")
print("") # print("")
page.predictions.doctags = DocTagsPrediction(tag_string=page_tags) page.predictions.doctags = DocTagsPrediction(tag_string=page_tags)
yield page yield page

View File

@ -334,9 +334,6 @@ class VlmPipeline(PaginatedPipeline):
xml_content = "" xml_content = ""
predicted_text = "" predicted_text = ""
if page.predictions.doctags: if page.predictions.doctags:
print("Doctags predicted for a page {}:".format(pg_idx))
print(page.predictions.doctags)
print("")
predicted_text = page.predictions.doctags.tag_string predicted_text = page.predictions.doctags.tag_string
image = page.image image = page.image
page_no = pg_idx + 1 page_no = pg_idx + 1
@ -382,9 +379,6 @@ class VlmPipeline(PaginatedPipeline):
elif tag_name == "picture": elif tag_name == "picture":
text_caption_content = extract_inner_text(full_chunk) text_caption_content = extract_inner_text(full_chunk)
print("----------- TEXT CONTENT OF A PICTURE TAG -------------")
print(text_caption_content)
print("-------------------------------------------------------")
if image: if image:
if bbox: if bbox:
width, height = image.size width, height = image.size