Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -115,53 +115,58 @@ def get_card(item: dict, index: int, card_type: str = "space") -> str:
|
|
115 |
gpu_memory = gpu_info.get('memory', 'N/A')
|
116 |
gpu_info = f"{gpu_type} ({gpu_memory}GB)"
|
117 |
|
118 |
-
# 카드 타입별 그라데이션 설정
|
119 |
-
if card_type == "space":
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
|
|
|
|
|
|
|
|
|
|
163 |
|
164 |
-
# 하드웨어 정보 HTML
|
165 |
hardware_info = f"""
|
166 |
<div style='
|
167 |
margin-top: 15px;
|
@@ -187,6 +192,7 @@ else: # dataset
|
|
187 |
"""
|
188 |
|
189 |
# 태그 표시 (models와 datasets용)
|
|
|
190 |
if card_type != "space":
|
191 |
tags_html = f"""
|
192 |
<div style='
|
@@ -211,9 +217,8 @@ else: # dataset
|
|
211 |
''' for tag in tags[:5]])}
|
212 |
</div>
|
213 |
"""
|
214 |
-
else:
|
215 |
-
tags_html = ""
|
216 |
|
|
|
217 |
return f"""
|
218 |
<div class="card" style='
|
219 |
position: relative;
|
|
|
115 |
gpu_memory = gpu_info.get('memory', 'N/A')
|
116 |
gpu_info = f"{gpu_type} ({gpu_memory}GB)"
|
117 |
|
118 |
+
# 카드 타입별 그라데이션 설정
|
119 |
+
if card_type == "space":
|
120 |
+
gradient_colors = """
|
121 |
+
rgba(255, 182, 193, 0.7), /* 파스텔 핑크 */
|
122 |
+
rgba(173, 216, 230, 0.7), /* 파스텔 블루 */
|
123 |
+
rgba(255, 218, 185, 0.7) /* 파스텔 피치 */
|
124 |
+
"""
|
125 |
+
bg_content = f"""
|
126 |
+
background-image: url(data:image/png;base64,{get_cached_screenshot(url) if get_cached_screenshot(url) else ''});
|
127 |
+
background-size: cover;
|
128 |
+
background-position: center;
|
129 |
+
"""
|
130 |
+
content_bg = f"""
|
131 |
+
background: linear-gradient(135deg, {gradient_colors});
|
132 |
+
backdrop-filter: blur(10px);
|
133 |
+
"""
|
134 |
+
type_icon = "🎯"
|
135 |
+
type_label = "SPACE"
|
136 |
+
elif card_type == "model":
|
137 |
+
gradient_colors = """
|
138 |
+
rgba(110, 142, 251, 0.7), /* 모델 블루 */
|
139 |
+
rgba(130, 158, 251, 0.7),
|
140 |
+
rgba(150, 174, 251, 0.7)
|
141 |
+
"""
|
142 |
+
bg_content = f"""
|
143 |
+
background: linear-gradient(135deg, #6e8efb, #4a6cf7);
|
144 |
+
padding: 15px;
|
145 |
+
"""
|
146 |
+
content_bg = f"""
|
147 |
+
background: linear-gradient(135deg, {gradient_colors});
|
148 |
+
backdrop-filter: blur(10px);
|
149 |
+
"""
|
150 |
+
type_icon = "🤖"
|
151 |
+
type_label = "MODEL"
|
152 |
+
else: # dataset
|
153 |
+
gradient_colors = """
|
154 |
+
rgba(255, 107, 107, 0.7), /* 데이터셋 레드 */
|
155 |
+
rgba(255, 127, 127, 0.7),
|
156 |
+
rgba(255, 147, 147, 0.7)
|
157 |
+
"""
|
158 |
+
bg_content = f"""
|
159 |
+
background: linear-gradient(135deg, #ff6b6b, #ff8787);
|
160 |
+
padding: 15px;
|
161 |
+
"""
|
162 |
+
content_bg = f"""
|
163 |
+
background: linear-gradient(135deg, {gradient_colors});
|
164 |
+
backdrop-filter: blur(10px);
|
165 |
+
"""
|
166 |
+
type_icon = "📊"
|
167 |
+
type_label = "DATASET"
|
168 |
|
169 |
+
# 하드웨어 정보 HTML
|
170 |
hardware_info = f"""
|
171 |
<div style='
|
172 |
margin-top: 15px;
|
|
|
192 |
"""
|
193 |
|
194 |
# 태그 표시 (models와 datasets용)
|
195 |
+
tags_html = ""
|
196 |
if card_type != "space":
|
197 |
tags_html = f"""
|
198 |
<div style='
|
|
|
217 |
''' for tag in tags[:5]])}
|
218 |
</div>
|
219 |
"""
|
|
|
|
|
220 |
|
221 |
+
# 카드 HTML 반환
|
222 |
return f"""
|
223 |
<div class="card" style='
|
224 |
position: relative;
|