Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions samples/js/web-server-responses-vision-example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if (currentEp !== '') process.stdout.write('\n');
// </init>

if (listModels) {
const allModels = await manager.catalog.listModels();
const allModels = await manager.catalog.getModels();
const visionModels = allModels
.filter((m) => (m.info?.task ?? '').toLowerCase().includes('vision'))
.sort((a, b) => a.alias.localeCompare(b.alias));
Expand Down Expand Up @@ -85,7 +85,7 @@ if (listModels) {
const device = v.info?.runtime?.deviceType ?? '';
const ep = v.info?.runtime?.executionProvider ?? '';
const size = v.info?.fileSizeMb != null ? String(v.info.fileSizeMb).padStart(10) : ''.padStart(10);
const cached = (await v.isCached()) ? 'yes' : 'no';
const cached = v.isCached ? 'yes' : 'no';
console.log(` ${v.id.padEnd(54)} ${device.padEnd(6)} ${ep.padEnd(32)} ${size} ${cached}`);
}
}
Expand All @@ -98,7 +98,7 @@ if (!model) {
model = await manager.catalog.getModelVariant(modelIdentifier);
}
if (!model) {
const allModels = await manager.catalog.listModels();
const allModels = await manager.catalog.getModels();
console.error(`\nModel '${modelIdentifier}' not found in catalog (tried alias and variant id).`);
console.error(`Available aliases: ${allModels.map((m) => m.alias).join(', ')}`);
console.error('Run with --list-models to see variant ids.');
Expand Down
Loading