Fixed class filter & new models count in featherless.ai
| @@ -472,6 +472,7 @@ export async function loadFeatherlessModels(data) { | |||
| 472 | featherlessTop = await fetchFeatherlessStats(); | 472 | featherlessTop = await fetchFeatherlessStats(); |
| 473 | } | 473 | } |
| 474 | const featherlessIds = featherlessTop.map(stat => stat.id); | 474 | const featherlessIds = featherlessTop.map(stat => stat.id); |
| 475 | |||
| 475 | if (selectedCategory === 'New') { | 476 | if (selectedCategory === 'New') { |
| 476 | featherlessNew = await fetchFeatherlessNew(); | 477 | featherlessNew = await fetchFeatherlessNew(); |
| 477 | } | 478 | } |
| @@ -493,7 +494,7 @@ export async function loadFeatherlessModels(data) { | |||
| 493 | return matchesSearch && matchesClass && matchesNew; | 494 | return matchesSearch && matchesClass && matchesNew; |
| 494 | } | 495 | } |
| 495 | else { | 496 | else { |
| 496 | return matchesSearch; | 497 | return matchesSearch && matchesClass; |
| 497 | } | 498 | } |
| 498 | }); | 499 | }); |
| 499 | 500 | ||
| @@ -528,7 +529,7 @@ async function fetchFeatherlessStats() { | |||
| 528 | } | 529 | } |
| 529 | 530 | ||
| 530 | async function fetchFeatherlessNew() { | 531 | async function fetchFeatherlessNew() { |
| 531 | const response = await fetch('https://api.featherless.ai/feather/models?sort=-created_at&perPage=10'); | 532 | const response = await fetch('https://api.featherless.ai/feather/models?sort=-created_at&perPage=20'); |
| 532 | const data = await response.json(); | 533 | const data = await response.json(); |
| 533 | return data.items; | 534 | return data.items; |
| 534 | } | 535 | } |