Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -85,6 +85,29 @@ def take_screenshot(url):
|
|
| 85 |
if 'driver' in locals():
|
| 86 |
driver.quit()
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
def get_card(item: dict, index: int, card_type: str = "space") -> str:
|
| 89 |
"""통합 카드 HTML 생성"""
|
| 90 |
item_id = item.get('id', '')
|
|
@@ -168,6 +191,9 @@ def get_card(item: dict, index: int, card_type: str = "space") -> str:
|
|
| 168 |
|
| 169 |
|
| 170 |
|
|
|
|
|
|
|
|
|
|
| 171 |
# 하드웨어 정보 HTML
|
| 172 |
hardware_info = f"""
|
| 173 |
<div style='
|
|
@@ -182,11 +208,9 @@ def get_card(item: dict, index: int, card_type: str = "space") -> str:
|
|
| 182 |
gap: 10px;'>
|
| 183 |
<div style='color: #444;'>
|
| 184 |
<span style='margin-right: 5px;'>💻</span> CPU: {cpu_info}
|
| 185 |
-
|
| 186 |
</div>
|
| 187 |
<div style='color: #444;'>
|
| 188 |
<span style='margin-right: 5px;'>🎮</span> GPU: {gpu_info}
|
| 189 |
-
|
| 190 |
</div>
|
| 191 |
<div style='color: #444;'>
|
| 192 |
<span style='margin-right: 5px;'>🛠️</span> SDK: {sdk}
|
|
|
|
| 85 |
if 'driver' in locals():
|
| 86 |
driver.quit()
|
| 87 |
|
| 88 |
+
def get_hardware_info(item: dict) -> tuple:
|
| 89 |
+
"""하드웨어 정보 추출"""
|
| 90 |
+
hardware = item.get('hardware', {})
|
| 91 |
+
|
| 92 |
+
# CPU 정보 처리
|
| 93 |
+
cpu_info = hardware.get('cpu', 'Standard')
|
| 94 |
+
|
| 95 |
+
# GPU 정보 처리
|
| 96 |
+
gpu_info = hardware.get('gpu', {})
|
| 97 |
+
if isinstance(gpu_info, dict):
|
| 98 |
+
gpu_name = gpu_info.get('name', '')
|
| 99 |
+
gpu_memory = gpu_info.get('memory', '')
|
| 100 |
+
gpu_info = f"{gpu_name} ({gpu_memory}GB)" if gpu_name and gpu_memory else "None"
|
| 101 |
+
elif isinstance(gpu_info, str):
|
| 102 |
+
gpu_info = gpu_info if gpu_info else "None"
|
| 103 |
+
else:
|
| 104 |
+
gpu_info = "None"
|
| 105 |
+
|
| 106 |
+
# SDK 정보 처리
|
| 107 |
+
sdk = item.get('sdk', 'N/A')
|
| 108 |
+
|
| 109 |
+
return cpu_info, gpu_info, sdk
|
| 110 |
+
|
| 111 |
def get_card(item: dict, index: int, card_type: str = "space") -> str:
|
| 112 |
"""통합 카드 HTML 생성"""
|
| 113 |
item_id = item.get('id', '')
|
|
|
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
+
# 하드웨어 정보 가져오기
|
| 195 |
+
cpu_info, gpu_info, sdk = get_hardware_info(item)
|
| 196 |
+
|
| 197 |
# 하드웨어 정보 HTML
|
| 198 |
hardware_info = f"""
|
| 199 |
<div style='
|
|
|
|
| 208 |
gap: 10px;'>
|
| 209 |
<div style='color: #444;'>
|
| 210 |
<span style='margin-right: 5px;'>💻</span> CPU: {cpu_info}
|
|
|
|
| 211 |
</div>
|
| 212 |
<div style='color: #444;'>
|
| 213 |
<span style='margin-right: 5px;'>🎮</span> GPU: {gpu_info}
|
|
|
|
| 214 |
</div>
|
| 215 |
<div style='color: #444;'>
|
| 216 |
<span style='margin-right: 5px;'>🛠️</span> SDK: {sdk}
|