- Added ConfigParser module for parsing Hugging Face config files - Added model name display above form - Added file upload for config.json (accepts only .json files) - Added reset button to clear all fields - Added error indicators (!) with language-aware messages for missing fields - Auto-populates fields: num_hidden_layers, num_key_value_heads, head_dim, num_attention_heads, max_position_embeddings, full_attention_interval - Sets defaults for optional fields: parallel=1, model_size=0 - Auto-calculates after successful config upload - Default quantization set to f16
369 lines
6 KiB
CSS
369 lines
6 KiB
CSS
/*
|
|
* LLM Context Memory Calculator - Retro Style CSS
|
|
* White background, sharp borders, high contrast
|
|
*/
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
body {
|
|
font-family: system-ui, -apple-system, sans-serif;
|
|
background-color: #FFFFFF;
|
|
color: #000000;
|
|
line-height: 1.6;
|
|
padding: 20px;
|
|
}
|
|
|
|
.container {
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
border: 3px solid #000000;
|
|
padding: 20px;
|
|
}
|
|
|
|
.header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
h1 {
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 28px;
|
|
font-weight: bold;
|
|
color: #0000FF;
|
|
border-bottom: 2px solid #0000FF;
|
|
padding-bottom: 10px;
|
|
flex-grow: 1;
|
|
}
|
|
|
|
.lang-btn {
|
|
background-color: #000000;
|
|
color: #FFFFFF;
|
|
border: 2px solid #000000;
|
|
padding: 5px 10px;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 14px;
|
|
font-weight: bold;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.lang-btn:hover {
|
|
background-color: #333333;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 15px;
|
|
position: relative;
|
|
}
|
|
|
|
label {
|
|
display: block;
|
|
font-weight: bold;
|
|
margin-bottom: 5px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
input[type="number"],
|
|
select {
|
|
width: 100%;
|
|
padding: 8px;
|
|
border: 2px solid #000000;
|
|
background-color: #FFFFFF;
|
|
color: #000000;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 16px;
|
|
border-radius: 0;
|
|
}
|
|
|
|
input[type="number"]:focus,
|
|
select:focus {
|
|
outline: none;
|
|
border-color: #0000FF;
|
|
box-shadow: 0 0 5px rgba(0, 0, 255, 0.5);
|
|
}
|
|
|
|
input[type="number"]::placeholder {
|
|
color: #666666;
|
|
}
|
|
|
|
.checkbox-group {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.checkbox-group input[type="checkbox"] {
|
|
width: auto;
|
|
margin-right: 10px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.checkbox-group label {
|
|
margin-bottom: 0;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.asymmetric-controls {
|
|
display: none;
|
|
border: 2px solid #000000;
|
|
padding: 15px;
|
|
margin-top: 10px;
|
|
background-color: #F5F5F5;
|
|
}
|
|
|
|
.asymmetric-controls.visible {
|
|
display: block;
|
|
}
|
|
|
|
.asymmetric-controls .form-group {
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
button {
|
|
width: 100%;
|
|
padding: 12px;
|
|
background-color: #000000;
|
|
color: #FFFFFF;
|
|
border: none;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 16px;
|
|
font-weight: bold;
|
|
cursor: pointer;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
button:hover {
|
|
background-color: #333333;
|
|
}
|
|
|
|
.results {
|
|
margin-top: 20px;
|
|
border: 2px solid #000000;
|
|
padding: 15px;
|
|
}
|
|
|
|
.results h2 {
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 18px;
|
|
margin-bottom: 10px;
|
|
color: #000000;
|
|
border-bottom: 1px solid #000000;
|
|
padding-bottom: 5px;
|
|
}
|
|
|
|
.result-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 5px 0;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.result-item::before {
|
|
content: '├─';
|
|
margin-right: 5px;
|
|
color: #000000;
|
|
}
|
|
|
|
.result-item:last-child::before {
|
|
content: '└─';
|
|
}
|
|
|
|
.result-item .label {
|
|
color: #333333;
|
|
}
|
|
|
|
.result-item .value {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.result-item.total::before {
|
|
content: '└─';
|
|
color: #0000FF;
|
|
}
|
|
|
|
.result-item.total .value {
|
|
color: #0000FF;
|
|
}
|
|
|
|
.example {
|
|
margin-top: 20px;
|
|
padding: 10px;
|
|
border: 1px solid #CCCCCC;
|
|
background-color: #FAFAFA;
|
|
}
|
|
|
|
.example p {
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 12px;
|
|
color: #666666;
|
|
}
|
|
|
|
.error-message {
|
|
background-color: #FFEEEE;
|
|
border: 2px solid #FF0000;
|
|
color: #FF0000;
|
|
padding: 10px;
|
|
margin-top: 10px;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.error-message ul {
|
|
margin-left: 20px;
|
|
}
|
|
|
|
.error-message li {
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
/* Tooltip Styles */
|
|
.tooltip-icon {
|
|
display: inline-block;
|
|
width: 16px;
|
|
height: 16px;
|
|
background-color: #000000;
|
|
color: #FFFFFF;
|
|
text-align: center;
|
|
line-height: 16px;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 12px;
|
|
font-weight: bold;
|
|
margin-left: 5px;
|
|
cursor: help;
|
|
vertical-align: middle;
|
|
position: relative;
|
|
}
|
|
|
|
.tooltip-icon::before {
|
|
content: "?";
|
|
}
|
|
|
|
/* Hide both languages by default */
|
|
.tooltip-icon[data-tooltip-ru],
|
|
.tooltip-icon[data-tooltip-en] {
|
|
display: none;
|
|
}
|
|
|
|
/* Show Russian when html lang is ru */
|
|
html[lang="ru"] .tooltip-icon[data-tooltip-ru] {
|
|
display: inline-block;
|
|
}
|
|
|
|
/* Show English when html lang is en */
|
|
html[lang="en"] .tooltip-icon[data-tooltip-en] {
|
|
display: inline-block;
|
|
}
|
|
|
|
.tooltip-icon:hover {
|
|
background-color: #0000FF;
|
|
}
|
|
|
|
/* Tooltip popup for Russian */
|
|
html[lang="ru"] .tooltip-icon:hover::after {
|
|
content: attr(data-tooltip-ru);
|
|
position: absolute;
|
|
bottom: 100%;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
background-color: #000000;
|
|
color: #FFFFFF;
|
|
padding: 12px 16px;
|
|
font-size: 11px;
|
|
white-space: pre-wrap;
|
|
width: 375px;
|
|
z-index: 1000;
|
|
line-height: 1.4;
|
|
text-align: left;
|
|
}
|
|
|
|
/* Tooltip popup for English */
|
|
html[lang="en"] .tooltip-icon:hover::after {
|
|
content: attr(data-tooltip-en);
|
|
position: absolute;
|
|
bottom: 100%;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
background-color: #000000;
|
|
color: #FFFFFF;
|
|
padding: 12px 16px;
|
|
font-size: 11px;
|
|
white-space: pre-wrap;
|
|
width: 375px;
|
|
z-index: 1000;
|
|
line-height: 1.4;
|
|
text-align: left;
|
|
}
|
|
|
|
.model-name {
|
|
text-align: center;
|
|
font-weight: bold;
|
|
margin-bottom: 15px;
|
|
color: #0000FF;
|
|
}
|
|
|
|
.error-icon {
|
|
display: none;
|
|
font-size: 14px;
|
|
font-weight: bold;
|
|
line-height: 1;
|
|
cursor: help;
|
|
user-select: none;
|
|
}
|
|
|
|
.error-icon:hover::after {
|
|
content: attr(data-tooltip);
|
|
position: absolute;
|
|
bottom: 100%;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
background-color: #FF0000;
|
|
color: #FFFFFF;
|
|
padding: 8px 12px;
|
|
font-size: 11px;
|
|
white-space: pre-wrap;
|
|
max-width: 300px;
|
|
z-index: 1000;
|
|
line-height: 1.4;
|
|
text-align: center;
|
|
}
|
|
|
|
#reset-btn {
|
|
background-color: #333333;
|
|
width: auto;
|
|
padding: 8px 16px;
|
|
}
|
|
|
|
#reset-btn:hover {
|
|
background-color: #555555;
|
|
}
|
|
|
|
@media (max-width: 600px) {
|
|
.container {
|
|
padding: 15px;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 22px;
|
|
}
|
|
|
|
input[type="number"],
|
|
select {
|
|
font-size: 14px;
|
|
}
|
|
|
|
.header {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
gap: 10px;
|
|
}
|
|
|
|
.lang-btn {
|
|
align-self: flex-end;
|
|
}
|
|
}
|