Spaces:
Sleeping
Sleeping
Update app.py
Browse filestry to fix error returning too many values
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)
|
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)
|