MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / initOne

Function initOne

docs/source/_static/config_selector.js:176–564  ·  view source on GitHub ↗
(container, payload)

Source from the content-addressed store, hash-verified

174 }
175
176 function initOne(container, payload) {
177 const allowedModels = parseCsvModels(container.getAttribute("data-models"));
178
179 const allEntries = Array.isArray(payload.entries) ? payload.entries : [];
180 const entries = allowedModels
181 ? allEntries.filter((e) => allowedModels.includes(e.model))
182 : allEntries.slice();
183
184 const modelsInfo = payload.models || {};
185
186 const state = {
187 model: "",
188 topology: "",
189 islOsl: "",
190 profile: "",
191 concurrency: "",
192 };
193
194 container.innerHTML = "";
195 container.classList.add("trtllm-config-selector");
196
197 const header = el("div", { class: "trtllm-config-selector__header" }, [
198 el("div", {
199 class: "trtllm-config-selector__subtitle",
200 text: "Select a model + deployment shape to generate a trtllm-serve command.",
201 }),
202 ]);
203
204 const form = el("div", { class: "trtllm-config-selector__form" });
205
206 function mkSelect(labelText, id, stepNumber) {
207 const label = el("label", {
208 class: "trtllm-config-selector__label",
209 for: id,
210 });
211 label.appendChild(
212 el("span", {
213 class: "trtllm-config-selector__step",
214 "aria-hidden": "true",
215 text: String(stepNumber),
216 }),
217 );
218 label.appendChild(
219 el("span", {
220 class: "trtllm-config-selector__labelText",
221 text: labelText,
222 }),
223 );
224 const select = el("select", { class: "trtllm-config-selector__select", id });
225 const wrap = el("div", { class: "trtllm-config-selector__field" }, [label, select]);
226 return { wrap, select };
227 }
228
229 const id = ++widgetId;
230 const selModel = mkSelect("Model", `trtllm-model-${id}`, 1);
231 const selTopo = mkSelect("GPU(s)", `trtllm-topo-${id}`, 2);
232 const selSeq = mkSelect("ISL / OSL", `trtllm-seq-${id}`, 3);
233 const selProf = mkSelect("Performance profile", `trtllm-prof-${id}`, 4);

Callers 1

mainFunction · 0.85

Calls 11

parseCsvModelsFunction · 0.85
elFunction · 0.85
mkSelectFunction · 0.85
$Function · 0.85
resetYamlPanelFunction · 0.85
fetchYamlForFunction · 0.85
highlightYamlFunction · 0.85
copyTextFunction · 0.85
renderFunction · 0.85
filterMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected