MCPcopy Create free account
hub / github.com/anomalyco/models.dev / loadExistingModel

Function loadExistingModel

packages/core/script/generate-wandb.ts:227–240  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

225}
226
227async function loadExistingModel(filePath: string): Promise<ExistingModel | null> {
228 try {
229 const file = Bun.file(filePath);
230 if (!(await file.exists())) {
231 return null;
232 }
233
234 const toml = await import(filePath, { with: { type: "toml" } }).then((mod) => mod.default);
235 return toml as ExistingModel;
236 } catch (cause) {
237 console.warn(`Warning: Failed to parse existing file ${filePath}:`, cause);
238 return null;
239 }
240}
241
242function mergeModel(
243 apiModel: z.infer<typeof WandbModel>,

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected