Spaces:
Runtime error
Runtime error
Fix attributes (#1)
Browse files- Fix attributes (0441d94a643b9ec45c8281fb6f4451fc1ae8c4c0)
app.py
CHANGED
@@ -188,12 +188,12 @@ def get_predicted_attributes(image_urls, category):
|
|
188 |
if key == "details":
|
189 |
details_split = value.split(" , ")
|
190 |
if len(details_split) == 2:
|
191 |
-
result["
|
192 |
-
result["
|
193 |
else:
|
194 |
-
result["
|
195 |
else:
|
196 |
-
result[key] = value
|
197 |
|
198 |
return result
|
199 |
|
|
|
188 |
if key == "details":
|
189 |
details_split = value.split(" , ")
|
190 |
if len(details_split) == 2:
|
191 |
+
result["details1"] = details_split[0].lower()
|
192 |
+
result["details2"] = details_split[1].lower()
|
193 |
else:
|
194 |
+
result["details1"] = value.lower() # If there's only one detail, assign it to details 1
|
195 |
else:
|
196 |
+
result[key.lower().replace("collar", "colartype").replace("sleeve length", "sleevelength").replace("fabric", "fabricstyle")] = value.lower()
|
197 |
|
198 |
return result
|
199 |
|