Update app.py
Browse files
app.py
CHANGED
|
@@ -88,7 +88,9 @@ if api_key:
|
|
| 88 |
database_info = []
|
| 89 |
for item in data:
|
| 90 |
image_url = item['์ด๋ฏธ์ง ๋งํฌ'][0]
|
| 91 |
-
|
|
|
|
|
|
|
| 92 |
response = requests.get(image_url)
|
| 93 |
with open(image_path, 'wb') as f:
|
| 94 |
f.write(response.content)
|
|
@@ -98,7 +100,7 @@ if api_key:
|
|
| 98 |
|
| 99 |
database_embeddings.append(embedding)
|
| 100 |
database_info.append({
|
| 101 |
-
'id':
|
| 102 |
'category': item['์นดํ
๊ณ ๋ฆฌ'],
|
| 103 |
'brand': item['๋ธ๋๋๋ช
'],
|
| 104 |
'name': item['์ ํ๋ช
'],
|
|
|
|
| 88 |
database_info = []
|
| 89 |
for item in data:
|
| 90 |
image_url = item['์ด๋ฏธ์ง ๋งํฌ'][0]
|
| 91 |
+
# '\ufeff์ํ ID' ๋์ '์ํ ID'๋ฅผ ์ฌ์ฉํ๊ฑฐ๋, ๋ค์๊ณผ ๊ฐ์ด ์์
|
| 92 |
+
product_id = item.get('\ufeff์ํ ID') or item.get('์ํ ID')
|
| 93 |
+
image_path = "temp_{}.jpg".format(product_id)
|
| 94 |
response = requests.get(image_url)
|
| 95 |
with open(image_path, 'wb') as f:
|
| 96 |
f.write(response.content)
|
|
|
|
| 100 |
|
| 101 |
database_embeddings.append(embedding)
|
| 102 |
database_info.append({
|
| 103 |
+
'id': product_id,
|
| 104 |
'category': item['์นดํ
๊ณ ๋ฆฌ'],
|
| 105 |
'brand': item['๋ธ๋๋๋ช
'],
|
| 106 |
'name': item['์ ํ๋ช
'],
|