Fixed class filter & new models count in featherless.ai

This commit is contained in:
Eradev
2025-01-15 00:35:40 -05:00
parent 6b494af146
commit c1535f1b34

View File

@ -472,6 +472,7 @@ export async function loadFeatherlessModels(data) {
featherlessTop = await fetchFeatherlessStats(); featherlessTop = await fetchFeatherlessStats();
} }
const featherlessIds = featherlessTop.map(stat => stat.id); const featherlessIds = featherlessTop.map(stat => stat.id);
if (selectedCategory === 'New') { if (selectedCategory === 'New') {
featherlessNew = await fetchFeatherlessNew(); featherlessNew = await fetchFeatherlessNew();
} }
@ -493,7 +494,7 @@ export async function loadFeatherlessModels(data) {
return matchesSearch && matchesClass && matchesNew; return matchesSearch && matchesClass && matchesNew;
} }
else { else {
return matchesSearch; return matchesSearch && matchesClass;
} }
}); });
@ -528,7 +529,7 @@ async function fetchFeatherlessStats() {
} }
async function fetchFeatherlessNew() { async function fetchFeatherlessNew() {
const response = await fetch('https://api.featherless.ai/feather/models?sort=-created_at&perPage=10'); const response = await fetch('https://api.featherless.ai/feather/models?sort=-created_at&perPage=20');
const data = await response.json(); const data = await response.json();
return data.items; return data.items;
} }