Spaces:
Sleeping
Sleeping
test
Browse files- app/static/css/styles.css +36 -28
- app/static/js/main.js +52 -44
- app/templates/index.html +1 -0
app/static/css/styles.css
CHANGED
@@ -136,21 +136,21 @@ body {
|
|
136 |
}
|
137 |
|
138 |
.model-card h3 {
|
139 |
-
font-size:
|
140 |
margin-bottom: 8px;
|
141 |
-
color: var(--
|
142 |
-
font-weight:
|
143 |
}
|
144 |
|
145 |
.model-card .subtitle {
|
146 |
-
color: var(--text
|
147 |
font-size: 0.9rem;
|
148 |
margin-bottom: 12px;
|
149 |
font-weight: 500;
|
150 |
}
|
151 |
|
152 |
.model-card p {
|
153 |
-
color: var(--text
|
154 |
font-size: 0.9rem;
|
155 |
margin-bottom: 5px;
|
156 |
}
|
@@ -225,45 +225,42 @@ body {
|
|
225 |
|
226 |
.config-list {
|
227 |
display: grid;
|
228 |
-
|
|
|
|
|
229 |
}
|
230 |
|
231 |
.config-card {
|
|
|
232 |
border: 1px solid var(--border);
|
233 |
border-radius: 8px;
|
234 |
padding: 20px;
|
|
|
|
|
235 |
}
|
236 |
|
237 |
-
.config-card
|
238 |
-
|
239 |
-
|
240 |
-
color: var(--primary-dark);
|
241 |
}
|
242 |
|
243 |
-
.config-
|
244 |
display: flex;
|
245 |
flex-direction: column;
|
246 |
-
gap:
|
247 |
-
}
|
248 |
-
|
249 |
-
.config-group {
|
250 |
-
background: var(--secondary);
|
251 |
-
border-radius: 6px;
|
252 |
-
padding: 15px;
|
253 |
}
|
254 |
|
255 |
-
.config-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
font-weight: 600;
|
260 |
}
|
261 |
|
262 |
.detail-item {
|
263 |
display: flex;
|
264 |
justify-content: space-between;
|
265 |
-
|
266 |
-
padding:
|
267 |
border-bottom: 1px solid var(--border);
|
268 |
}
|
269 |
|
@@ -272,12 +269,13 @@ body {
|
|
272 |
}
|
273 |
|
274 |
.detail-item strong {
|
275 |
-
color: var(--text);
|
276 |
-
font-
|
277 |
}
|
278 |
|
279 |
.detail-item span {
|
280 |
-
color: var(--text
|
|
|
281 |
}
|
282 |
|
283 |
/* Empty State */
|
@@ -294,6 +292,12 @@ body {
|
|
294 |
}
|
295 |
|
296 |
/* Responsive */
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
@media (max-width: 768px) {
|
298 |
.model-grid {
|
299 |
grid-template-columns: 1fr;
|
@@ -308,6 +312,10 @@ body {
|
|
308 |
align-items: flex-start;
|
309 |
gap: 15px;
|
310 |
}
|
|
|
|
|
|
|
|
|
311 |
}
|
312 |
|
313 |
/* Loading spinner */
|
|
|
136 |
}
|
137 |
|
138 |
.model-card h3 {
|
139 |
+
font-size: 0.9rem;
|
140 |
margin-bottom: 8px;
|
141 |
+
color: var(--text);
|
142 |
+
font-weight: 500;
|
143 |
}
|
144 |
|
145 |
.model-card .subtitle {
|
146 |
+
color: var(--text);
|
147 |
font-size: 0.9rem;
|
148 |
margin-bottom: 12px;
|
149 |
font-weight: 500;
|
150 |
}
|
151 |
|
152 |
.model-card p {
|
153 |
+
color: var(--text);
|
154 |
font-size: 0.9rem;
|
155 |
margin-bottom: 5px;
|
156 |
}
|
|
|
225 |
|
226 |
.config-list {
|
227 |
display: grid;
|
228 |
+
grid-template-columns: repeat(3, 1fr);
|
229 |
+
gap: 20px;
|
230 |
+
padding: 20px;
|
231 |
}
|
232 |
|
233 |
.config-card {
|
234 |
+
background: white;
|
235 |
border: 1px solid var(--border);
|
236 |
border-radius: 8px;
|
237 |
padding: 20px;
|
238 |
+
transition: var(--transition);
|
239 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
240 |
}
|
241 |
|
242 |
+
.config-card:hover {
|
243 |
+
transform: translateY(-2px);
|
244 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
|
|
245 |
}
|
246 |
|
247 |
+
.config-content {
|
248 |
display: flex;
|
249 |
flex-direction: column;
|
250 |
+
gap: 12px;
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
}
|
252 |
|
253 |
+
.config-card h4 {
|
254 |
+
font-size: 1.1rem;
|
255 |
+
margin-bottom: 10px;
|
256 |
+
color: var(--primary-dark);
|
|
|
257 |
}
|
258 |
|
259 |
.detail-item {
|
260 |
display: flex;
|
261 |
justify-content: space-between;
|
262 |
+
align-items: center;
|
263 |
+
padding: 8px 0;
|
264 |
border-bottom: 1px solid var(--border);
|
265 |
}
|
266 |
|
|
|
269 |
}
|
270 |
|
271 |
.detail-item strong {
|
272 |
+
color: var(--text-light);
|
273 |
+
font-size: 0.9rem;
|
274 |
}
|
275 |
|
276 |
.detail-item span {
|
277 |
+
color: var(--text);
|
278 |
+
font-weight: 500;
|
279 |
}
|
280 |
|
281 |
/* Empty State */
|
|
|
292 |
}
|
293 |
|
294 |
/* Responsive */
|
295 |
+
@media (max-width: 1200px) {
|
296 |
+
.config-list {
|
297 |
+
grid-template-columns: repeat(2, 1fr);
|
298 |
+
}
|
299 |
+
}
|
300 |
+
|
301 |
@media (max-width: 768px) {
|
302 |
.model-grid {
|
303 |
grid-template-columns: 1fr;
|
|
|
312 |
align-items: flex-start;
|
313 |
gap: 15px;
|
314 |
}
|
315 |
+
|
316 |
+
.config-list {
|
317 |
+
grid-template-columns: 1fr;
|
318 |
+
}
|
319 |
}
|
320 |
|
321 |
/* Loading spinner */
|
app/static/js/main.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
let models = [];
|
2 |
let currentPage = 1;
|
3 |
-
const modelsPerPage =
|
4 |
|
5 |
// DOM Elements
|
6 |
const modelGrid = document.getElementById('modelGrid');
|
@@ -66,53 +66,40 @@ async function showModelConfigurations(modelId) {
|
|
66 |
noConfig.style.display = 'block';
|
67 |
configList.innerHTML = '';
|
68 |
} else {
|
69 |
-
configs.forEach((config
|
70 |
const configCard = document.createElement('div');
|
71 |
configCard.className = 'config-card';
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
<h5>${groupName}</h5>
|
99 |
-
${Object.entries(groupFields)
|
100 |
-
.map(([key, value]) => `
|
101 |
-
<div class="detail-item">
|
102 |
-
<strong>${key.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}:</strong>
|
103 |
-
<span>${value}</span>
|
104 |
-
</div>
|
105 |
-
`).join('')}
|
106 |
</div>
|
107 |
-
`;
|
108 |
-
}
|
109 |
-
|
110 |
-
configCard.innerHTML = `
|
111 |
-
<h4>Configuration ${idx + 1}</h4>
|
112 |
-
<div class="config-details">
|
113 |
-
${detailsHtml}
|
114 |
</div>
|
115 |
`;
|
|
|
|
|
116 |
configList.appendChild(configCard);
|
117 |
});
|
118 |
}
|
@@ -151,7 +138,13 @@ function renderModels() {
|
|
151 |
setTimeout(() => {
|
152 |
const startIdx = (currentPage - 1) * modelsPerPage;
|
153 |
const endIdx = startIdx + modelsPerPage;
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
|
156 |
if (paginatedModels.length === 0) {
|
157 |
modelGrid.innerHTML = `
|
@@ -166,7 +159,7 @@ function renderModels() {
|
|
166 |
const modelCard = document.createElement('div');
|
167 |
modelCard.className = 'model-card';
|
168 |
modelCard.innerHTML = `
|
169 |
-
<h3>${model.name}</h3>
|
170 |
<p class="subtitle">Architecture: ${model.type}</p>
|
171 |
`;
|
172 |
modelCard.addEventListener('click', () => showModelConfigurations(model.id));
|
@@ -224,4 +217,19 @@ function goToNextPage() {
|
|
224 |
renderModels();
|
225 |
updatePagination();
|
226 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
}
|
|
|
1 |
let models = [];
|
2 |
let currentPage = 1;
|
3 |
+
const modelsPerPage = 12;
|
4 |
|
5 |
// DOM Elements
|
6 |
const modelGrid = document.getElementById('modelGrid');
|
|
|
66 |
noConfig.style.display = 'block';
|
67 |
configList.innerHTML = '';
|
68 |
} else {
|
69 |
+
configs.forEach((config) => {
|
70 |
const configCard = document.createElement('div');
|
71 |
configCard.className = 'config-card';
|
72 |
|
73 |
+
let detailsHtml = `
|
74 |
+
<div class="config-content">
|
75 |
+
<div class="detail-item">
|
76 |
+
<strong>Num Cores:</strong>
|
77 |
+
<span>${config.num_cores}</span>
|
78 |
+
</div>
|
79 |
+
<div class="detail-item">
|
80 |
+
<strong>Auto Cast Type:</strong>
|
81 |
+
<span>${config.auto_cast_type}</span>
|
82 |
+
</div>
|
83 |
+
<div class="detail-item">
|
84 |
+
<strong>Batch Size:</strong>
|
85 |
+
<span>${config.batch_size}</span>
|
86 |
+
</div>
|
87 |
+
<div class="detail-item">
|
88 |
+
<strong>Sequence Length:</strong>
|
89 |
+
<span>${config.sequence_length}</span>
|
90 |
+
</div>
|
91 |
+
<div class="detail-item">
|
92 |
+
<strong>Compiler Type:</strong>
|
93 |
+
<span>${config.compiler_type}</span>
|
94 |
+
</div>
|
95 |
+
<div class="detail-item">
|
96 |
+
<strong>Compiler Version:</strong>
|
97 |
+
<span>${config.compiler_version}</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
</div>
|
100 |
`;
|
101 |
+
|
102 |
+
configCard.innerHTML = detailsHtml;
|
103 |
configList.appendChild(configCard);
|
104 |
});
|
105 |
}
|
|
|
138 |
setTimeout(() => {
|
139 |
const startIdx = (currentPage - 1) * modelsPerPage;
|
140 |
const endIdx = startIdx + modelsPerPage;
|
141 |
+
|
142 |
+
// Sort models alphabetically by title (case-insensitive)
|
143 |
+
const sortedModels = [...models].sort((a, b) =>
|
144 |
+
a.name.toLowerCase().localeCompare(b.name.toLowerCase())
|
145 |
+
);
|
146 |
+
|
147 |
+
const paginatedModels = sortedModels.slice(startIdx, endIdx);
|
148 |
|
149 |
if (paginatedModels.length === 0) {
|
150 |
modelGrid.innerHTML = `
|
|
|
159 |
const modelCard = document.createElement('div');
|
160 |
modelCard.className = 'model-card';
|
161 |
modelCard.innerHTML = `
|
162 |
+
<h3><strong>${model.name}</strong></h3>
|
163 |
<p class="subtitle">Architecture: ${model.type}</p>
|
164 |
`;
|
165 |
modelCard.addEventListener('click', () => showModelConfigurations(model.id));
|
|
|
217 |
renderModels();
|
218 |
updatePagination();
|
219 |
}
|
220 |
+
}
|
221 |
+
|
222 |
+
function createConfigurationElement(config) {
|
223 |
+
const configElement = document.createElement('div');
|
224 |
+
configElement.className = 'config-item';
|
225 |
+
|
226 |
+
// Add your configuration content here, but skip the title
|
227 |
+
// For example:
|
228 |
+
configElement.innerHTML = `
|
229 |
+
<div class="config-content">
|
230 |
+
<!-- Your configuration details here -->
|
231 |
+
</div>
|
232 |
+
`;
|
233 |
+
|
234 |
+
return configElement;
|
235 |
}
|
app/templates/index.html
CHANGED
@@ -24,6 +24,7 @@
|
|
24 |
<div class="section-header">
|
25 |
<h2><i class="fas fa-list"></i> Available Models</h2>
|
26 |
</div>
|
|
|
27 |
|
28 |
<div id="modelGrid" class="model-grid">
|
29 |
<!-- Models will be populated here -->
|
|
|
24 |
<div class="section-header">
|
25 |
<h2><i class="fas fa-list"></i> Available Models</h2>
|
26 |
</div>
|
27 |
+
<p class="section-subtitle" style="margin-bottom: 20px;">Browse and select from all available model configurations</p>
|
28 |
|
29 |
<div id="modelGrid" class="model-grid">
|
30 |
<!-- Models will be populated here -->
|