(modelName: string, params: Partial<InferenceParams>)
| 649 | } |
| 650 | |
| 651 | public setModelParams(modelName: string, params: Partial<InferenceParams>): void { |
| 652 | const cleaned: Partial<InferenceParams> = {}; |
| 653 | for (const [k, v] of Object.entries(params)) { |
| 654 | if (v !== undefined && v !== null) (cleaned as any)[k] = v; |
| 655 | } |
| 656 | if (Object.keys(cleaned).length === 0) { |
| 657 | localStorage.removeItem(`${MODEL_PARAMS_PREFIX}${modelName}`); |
| 658 | } else { |
| 659 | localStorage.setItem(`${MODEL_PARAMS_PREFIX}${modelName}`, JSON.stringify(cleaned)); |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | public clearModelParams(modelName: string): void { |
| 664 | localStorage.removeItem(`${MODEL_PARAMS_PREFIX}${modelName}`); |
no outgoing calls
no test coverage detected