bcvilnrotter commited on
Commit
6320557
·
verified ·
1 Parent(s): 9946ff0

Update utils/basic_functions.py

Browse files
Files changed (1) hide show
  1. utils/basic_functions.py +3 -5
utils/basic_functions.py CHANGED
@@ -76,8 +76,6 @@ def request_manager(model_name,url):
76
  def gemini_identify_id(model_name,image,system_prompt):
77
  # 2. Function to process image with Gemini Pro Vision
78
  try:
79
- image = get_image(url)
80
-
81
  genai.configure(api_key=get_secret('GEMINI_API'))
82
 
83
  model = genai.GenerativeModel("gemini-2.0-flash")
@@ -85,11 +83,11 @@ def gemini_identify_id(model_name,image,system_prompt):
85
  response_text = response.text
86
  if not response_text:
87
  print('Could not find an ID number')
88
- exit()
89
- print(response_text)
90
 
91
  except Exception as e:
92
- return f"Error processing image: {str(e)}",None
93
 
94
  draw = ImageDraw.Draw(image)
95
  draw.rectangle(ast.literal_eval(response_text),outline='yellow',width=5)
 
76
  def gemini_identify_id(model_name,image,system_prompt):
77
  # 2. Function to process image with Gemini Pro Vision
78
  try:
 
 
79
  genai.configure(api_key=get_secret('GEMINI_API'))
80
 
81
  model = genai.GenerativeModel("gemini-2.0-flash")
 
83
  response_text = response.text
84
  if not response_text:
85
  print('Could not find an ID number')
86
+ return [image,'no response was received']
87
+ print(f"response_text: {response_text}")
88
 
89
  except Exception as e:
90
+ return [image,f"Error processing image: {str(e)}"]
91
 
92
  draw = ImageDraw.Draw(image)
93
  draw.rectangle(ast.literal_eval(response_text),outline='yellow',width=5)