Luis J Camargo commited on
Commit
2147761
·
1 Parent(s): 3f87369

feat: add logging for prediction pipeline output type and content

Browse files
Files changed (2) hide show
  1. app.py +3 -1
  2. requirements.txt +1 -1
app.py CHANGED
@@ -199,6 +199,8 @@ def run_inference(img_path, task_type="ocr"):
199
  try:
200
  logger.info(f"--- Inference Start: {task_type} ---")
201
  output = pipeline.predict(img_path)
 
 
202
 
203
  md_content = ""
204
  json_content = ""
@@ -207,7 +209,7 @@ def run_inference(img_path, task_type="ocr"):
207
  run_id = f"run_{int(time.time())}"
208
  run_output_dir = os.path.join(OUTPUT_DIR, run_id)
209
  os.makedirs(run_output_dir, exist_ok=True)
210
-
211
  for i, res in enumerate(output):
212
  res.save_to_json(save_path=run_output_dir)
213
  res.save_to_markdown(save_path=run_output_dir)
 
199
  try:
200
  logger.info(f"--- Inference Start: {task_type} ---")
201
  output = pipeline.predict(img_path)
202
+ logger.info(f"Output object type: {type(output)}")
203
+ logger.info(f"Output object: {output}")
204
 
205
  md_content = ""
206
  json_content = ""
 
209
  run_id = f"run_{int(time.time())}"
210
  run_output_dir = os.path.join(OUTPUT_DIR, run_id)
211
  os.makedirs(run_output_dir, exist_ok=True)
212
+
213
  for i, res in enumerate(output):
214
  res.save_to_json(save_path=run_output_dir)
215
  res.save_to_markdown(save_path=run_output_dir)
requirements.txt CHANGED
@@ -5,7 +5,7 @@ paddleocr[doc-parser]
5
  gradio
6
  pillow
7
  requests
8
- numpy
9
  psutil
10
  librosa
11
  pandas
 
5
  gradio
6
  pillow
7
  requests
8
+ numpy<2.0.0
9
  psutil
10
  librosa
11
  pandas