(modelName: string, params: Partial<InferenceParams>)
| 619 | } |
| 620 | |
| 621 | public setModelParams(modelName: string, params: Partial<InferenceParams>): void { |
| 622 | const cleaned: Partial<InferenceParams> = {}; |
| 623 | for (const [k, v] of Object.entries(params)) { |
| 624 | if (v !== undefined && v !== null) (cleaned as any)[k] = v; |
| 625 | } |
| 626 | if (Object.keys(cleaned).length === 0) { |
| 627 | localStorage.removeItem(`${MODEL_PARAMS_PREFIX}${modelName}`); |
| 628 | } else { |
| 629 | localStorage.setItem(`${MODEL_PARAMS_PREFIX}${modelName}`, JSON.stringify(cleaned)); |
| 630 | } |
| 631 | } |
| 632 | |
| 633 | public clearModelParams(modelName: string): void { |
| 634 | localStorage.removeItem(`${MODEL_PARAMS_PREFIX}${modelName}`); |
no outgoing calls
no test coverage detected