kfahn commited on
Commit
c5a5d17
·
verified ·
1 Parent(s): 1bbb448

Update app.py

Browse files

try to fix error returning too many values

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -50,7 +50,7 @@ image_sources = load_image_sources()
50
  def get_image_url(image_type: str):
51
  """Finds the best match for the given image type using fuzzy matching."""
52
  choices = list(image_sources.keys()) # Get all available keys
53
- best_match, score = process.extractOne(image_type, choices) # Find closest match
54
 
55
  if score > 90: # Set a threshold to ensure a reasonable match
56
  print(best_match)
 
50
  def get_image_url(image_type: str):
51
  """Finds the best match for the given image type using fuzzy matching."""
52
  choices = list(image_sources.keys()) # Get all available keys
53
+ best_match, score, *rest = process.extractOne(image_type, choices)
54
 
55
  if score > 90: # Set a threshold to ensure a reasonable match
56
  print(best_match)