()
| 179 | }); |
| 180 | |
| 181 | export const initializeModels = async () => { |
| 182 | const { |
| 183 | textModels: tm, |
| 184 | imageModels: im, |
| 185 | videoModels: vm, |
| 186 | audioModels: am, |
| 187 | } = await loadModels(); |
| 188 | const toObj = (arr) => |
| 189 | Object.fromEntries(arr.map((m) => [m.id, { name: m.name, ...m }])); |
| 190 | return { |
| 191 | textModels: toObj(tm), |
| 192 | imageModels: toObj(im), |
| 193 | videoModels: toObj(vm), |
| 194 | audioModels: toObj(am), |
| 195 | }; |
| 196 | }; |
| 197 | |
| 198 | const _getCurrentModelInfo = (modelId) => { |
| 199 | return [...textModels, ...imageModels, ...videoModels, ...audioModels].find( |
no test coverage detected