Fix tooltips and error icons after config parsing

- Call updateTooltips() after clearAllTooltips() to restore tooltip attributes
- Add error icons to all input fields (context-length, kv-heads, head-size,
  num-heads, num-layers, parallel, full-attention, hf-model)
- Update showConfigErrors() to handle hf-model field correctly
This commit is contained in:
Arseniy Romenskiy 2026-04-12 02:19:03 +03:00
parent ca578b93de
commit fd6208a376
2 changed files with 17 additions and 1 deletions

View file

@ -21,6 +21,7 @@
<label for="context-length" data-key="context_length_label">Длина Контекста (токены)</label>
<input type="number" id="context-length" placeholder="Введите длину контекста" required min="1">
<span class="tooltip-icon" data-tooltip-ru="Количество токенов в контексте. Влияет линейно на размер KV кеша" data-tooltip-en="Number of tokens in context. Affects KV cache size linearly"></span>
<span class="error-icon" style="display:none; color: #FF0000; cursor: help; margin-left: 5px;">!</span>
</div>
<div class="form-group">
@ -44,24 +45,28 @@
<label for="kv-heads" data-key="kv_heads_label">Головок KV</label>
<input type="number" id="kv-heads" placeholder="Введите количество головок KV" required min="1">
<span class="tooltip-icon" data-tooltip-ru="Количество голов внимания для K и V тензоров. Обычно num_key_value_heads в конфигурации модели" data-tooltip-en="Number of attention heads for K and V tensors. Usually num_key_value_heads in model config"></span>
<span class="error-icon" style="display:none; color: #FF0000; cursor: help; margin-left: 5px;">!</span>
</div>
<div class="form-group">
<label for="head-size" data-key="head_size_label">Размер Головки</label>
<input type="number" id="head-size" placeholder="Введите размер головы" required min="1">
<span class="tooltip-icon" data-tooltip-ru="Размер каждой головы внимания (head_dim). Влияет линейно на размер KV кеша" data-tooltip-en="Size of each attention head (head_dim). Affects KV cache size linearly"></span>
<span class="error-icon" style="display:none; color: #FF0000; cursor: help; margin-left: 5px;">!</span>
</div>
<div class="form-group">
<label for="num-heads" data-key="num_heads_label">Количество Головок</label>
<input type="number" id="num-heads" placeholder="Введите количество головок" required min="1">
<span class="tooltip-icon" data-tooltip-ru="Общее количество голов внимания. Используется только для информации и примеров" data-tooltip-en="Total number of attention heads. Used for display and examples only"></span>
<span class="error-icon" style="display:none; color: #FF0000; cursor: help; margin-left: 5px;">!</span>
</div>
<div class="form-group">
<label for="num-layers" data-key="num_layers_label">Количество Слов</label>
<input type="number" id="num-layers" placeholder="Введите количество слоев" required min="1">
<span class="tooltip-icon" data-tooltip-ru="Количество слоев модели. Каждый слой имеет свой KV кеш" data-tooltip-en="Number of model layers. Each layer has its own KV cache"></span>
<span class="error-icon" style="display:none; color: #FF0000; cursor: help; margin-left: 5px;">!</span>
</div>
<div class="form-group">
@ -74,12 +79,14 @@
<label for="parallel" data-key="parallel_label">Параллелизм (np)</label>
<input type="number" id="parallel" value="1" min="1" title="">
<span class="tooltip-icon" data-tooltip-ru="Количество параллельных последовательностей для декодирования (-np/--parallel в llama.cpp). Увеличивает KV кеш пропорционально" data-tooltip-en="Number of parallel sequences for decoding (-np/--parallel in llama.cpp). Increases KV cache proportionally"></span>
<span class="error-icon" style="display:none; color: #FF0000; cursor: help; margin-left: 5px;">!</span>
</div>
<div class="form-group">
<label for="full-attention" data-key="full_attention_label">Интервал Полного Внимания</label>
<input type="number" id="full-attention" placeholder="Опционально" min="1">
<span class="tooltip-icon" data-tooltip-ru="Интервал слоев для полного внимания. Слои считают полный KV кеш каждые N слоев. Уменьшает эффективное количество слоев" data-tooltip-en="Interval for full attention layers. Layers compute full KV cache every N layers. Reduces effective layer count"></span>
<span class="error-icon" style="display:none; color: #FF0000; cursor: help; margin-left: 5px;">!</span>
</div>
<div class="form-group" style="display: flex; align-items: center; gap: 10px;">
@ -94,6 +101,7 @@
<label for="hf-model" data-key="hf_model_label" style="margin-bottom: 0; white-space: nowrap;">Model (HuggingFace)</label>
<input type="text" id="hf-model" placeholder="" style="flex: 1;">
<button type="button" id="hf-fetch-btn" data-key="hf_fetch_btn" style="margin-bottom: 0;">Fetch</button>
<span class="error-icon" style="display:none; color: #FF0000; cursor: help; margin-left: 5px;">!</span>
</div>
<div id="loading-indicator" style="text-align: center; font-style: italic; color: #0000FF; padding: 10px; display: none;"></div>