MCPcopy Create free account
hub / github.com/pollinations/pollinations / initializeModels

Function initializeModels

apps/chat/src/utils/api.js:181–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179});
180
181export 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
198const _getCurrentModelInfo = (modelId) => {
199 return [...textModels, ...imageModels, ...videoModels, ...audioModels].find(

Callers 1

AppFunction · 0.90

Calls 2

loadModelsFunction · 0.85
toObjFunction · 0.85

Tested by

no test coverage detected