rongo1 commited on
Commit
657f105
Β·
1 Parent(s): d6f9d21

chore: replaced needed stuff

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -198,7 +198,7 @@ Return format: [card1_data, card2_data, card3_data, ...]
198
  logger.debug("Adding metadata to extracted data")
199
  for i, data in enumerate(response_data):
200
  # Use user-friendly model name for Excel
201
- data['method'] = "Speed-Optimized AI" if "flash" in model_name else "Accuracy-Optimized AI"
202
  if i < len(filenames):
203
  data['filename'] = filenames[i]
204
  logger.debug(f"Added metadata to card {i+1}: {filenames[i]}")
@@ -232,7 +232,7 @@ Return format: [card1_data, card2_data, card3_data, ...]
232
  logger.debug("Adding metadata to cleaned extracted data")
233
  for i, data in enumerate(response_data):
234
  # Use user-friendly model name for Excel
235
- data['method'] = "Speed-Optimized AI" if "flash" in model_name else "Accuracy-Optimized AI"
236
  if i < len(filenames):
237
  data['filename'] = filenames[i]
238
  logger.debug(f"Added metadata to cleaned card {i+1}: {filenames[i]}")
@@ -580,7 +580,7 @@ def process_business_cards(images, model_name="gemini-2.5-flash", save_images=Tr
580
  logger.info("Creating summary message")
581
  num_batches = len(image_batches) if 'image_batches' in locals() else 1
582
  summary = f"Successfully processed {len(all_data)} business card(s) in {num_batches} batch(es) of up to 5 cards.\n"
583
- model_display = "Speed-Optimized AI" if "flash" in model_name else "Accuracy-Optimized AI"
584
  summary += f"πŸ€– AI Model used: {model_display}\n"
585
  summary += f"⚑ API calls made: {num_batches} (instead of {len(all_data)})\n"
586
 
@@ -670,7 +670,7 @@ with gr.Blocks(title="Business Card Data Extractor") as demo:
670
  )
671
 
672
  model_selector = gr.Dropdown(
673
- choices=[("Accuracy-Optimized AI", "gemini-2.5-pro"), ("Speed-Optimized AI", "gemini-2.5-flash")],
674
  value="gemini-2.5-pro",
675
  label="AI Model Selection"
676
  )
@@ -711,7 +711,7 @@ with gr.Blocks(title="Business Card Data Extractor") as demo:
711
  gr.Markdown(
712
  """
713
  ## Features:
714
- - πŸ€– **Model Selection**: Choose between Speed-Optimized AI (fast) or Accuracy-Optimized AI (accurate)
715
  - ⚑ **Batch Processing**: Processes 5 cards per API call for efficiency
716
  - πŸ“„ **Data Extraction**: Names, emails, phone numbers, addresses, and more
717
  - πŸ“ž **Smart Combination**: Multiple emails/phones combined with commas
 
198
  logger.debug("Adding metadata to extracted data")
199
  for i, data in enumerate(response_data):
200
  # Use user-friendly model name for Excel
201
+ data['method'] = "Speed-Optimized model" if "flash" in model_name else "Accuracy-Optimized model"
202
  if i < len(filenames):
203
  data['filename'] = filenames[i]
204
  logger.debug(f"Added metadata to card {i+1}: {filenames[i]}")
 
232
  logger.debug("Adding metadata to cleaned extracted data")
233
  for i, data in enumerate(response_data):
234
  # Use user-friendly model name for Excel
235
+ data['method'] = "Speed-Optimized model" if "flash" in model_name else "Accuracy-Optimized model"
236
  if i < len(filenames):
237
  data['filename'] = filenames[i]
238
  logger.debug(f"Added metadata to cleaned card {i+1}: {filenames[i]}")
 
580
  logger.info("Creating summary message")
581
  num_batches = len(image_batches) if 'image_batches' in locals() else 1
582
  summary = f"Successfully processed {len(all_data)} business card(s) in {num_batches} batch(es) of up to 5 cards.\n"
583
+ model_display = "Speed-Optimized model" if "flash" in model_name else "Accuracy-Optimized model"
584
  summary += f"πŸ€– AI Model used: {model_display}\n"
585
  summary += f"⚑ API calls made: {num_batches} (instead of {len(all_data)})\n"
586
 
 
670
  )
671
 
672
  model_selector = gr.Dropdown(
673
+ choices=[("Accuracy-Optimized model", "gemini-2.5-pro"), ("Speed-Optimized model", "gemini-2.5-flash")],
674
  value="gemini-2.5-pro",
675
  label="AI Model Selection"
676
  )
 
711
  gr.Markdown(
712
  """
713
  ## Features:
714
+ - πŸ€– **Model Selection**: Choose between Speed-Optimized model (fast) or Accuracy-Optimized model (accurate)
715
  - ⚑ **Batch Processing**: Processes 5 cards per API call for efficiency
716
  - πŸ“„ **Data Extraction**: Names, emails, phone numbers, addresses, and more
717
  - πŸ“ž **Smart Combination**: Multiple emails/phones combined with commas