chore: update test case model service

This commit is contained in:
Faisal Amir 2025-08-17 22:57:56 +07:00
parent 9f39f0cdb8
commit 00674ec0d5
3 changed files with 12 additions and 10 deletions

View File

@ -115,8 +115,8 @@ function Hub() {
return (b.downloads || 0) - (a.downloads || 0) return (b.downloads || 0) - (a.downloads || 0)
} else { } else {
return ( return (
new Date(b.createdAt || 0).getTime() - new Date(b.created_at || 0).getTime() -
new Date(a.createdAt || 0).getTime() new Date(a.created_at || 0).getTime()
) )
} }
}) })

View File

@ -290,7 +290,7 @@ describe('models service', () => {
likes: 100, likes: 100,
tags: ['conversational', 'pytorch'], tags: ['conversational', 'pytorch'],
pipeline_tag: 'text-generation', pipeline_tag: 'text-generation',
created_at: '2023-01-01T00:00:00Z', createdAt: '2023-01-01T00:00:00Z',
last_modified: '2023-12-01T00:00:00Z', last_modified: '2023-12-01T00:00:00Z',
private: false, private: false,
disabled: false, disabled: false,
@ -443,7 +443,7 @@ describe('models service', () => {
likes: 100, likes: 100,
tags: ['conversational'], tags: ['conversational'],
pipeline_tag: 'text-generation', pipeline_tag: 'text-generation',
created_at: '2023-01-01T00:00:00Z', createdAt: '2023-01-01T00:00:00Z',
last_modified: '2023-12-01T00:00:00Z', last_modified: '2023-12-01T00:00:00Z',
private: false, private: false,
disabled: false, disabled: false,
@ -471,7 +471,7 @@ describe('models service', () => {
likes: 100, likes: 100,
tags: ['conversational'], tags: ['conversational'],
pipeline_tag: 'text-generation', pipeline_tag: 'text-generation',
created_at: '2023-01-01T00:00:00Z', createdAt: '2023-01-01T00:00:00Z',
last_modified: '2023-12-01T00:00:00Z', last_modified: '2023-12-01T00:00:00Z',
private: false, private: false,
disabled: false, disabled: false,
@ -510,7 +510,7 @@ describe('models service', () => {
likes: 100, likes: 100,
tags: ['conversational'], tags: ['conversational'],
pipeline_tag: 'text-generation', pipeline_tag: 'text-generation',
created_at: '2023-01-01T00:00:00Z', createdAt: '2023-01-01T00:00:00Z',
last_modified: '2023-12-01T00:00:00Z', last_modified: '2023-12-01T00:00:00Z',
private: false, private: false,
disabled: false, disabled: false,
@ -559,7 +559,7 @@ describe('models service', () => {
likes: 75, likes: 75,
tags: ['pytorch', 'transformers', 'text-generation'], tags: ['pytorch', 'transformers', 'text-generation'],
pipeline_tag: 'text-generation', pipeline_tag: 'text-generation',
created_at: '2021-01-01T00:00:00Z', createdAt: '2021-01-01T00:00:00Z',
last_modified: '2021-12-01T00:00:00Z', last_modified: '2021-12-01T00:00:00Z',
private: false, private: false,
disabled: false, disabled: false,
@ -605,6 +605,8 @@ describe('models service', () => {
file_size: '4.0 GB', file_size: '4.0 GB',
}, },
], ],
num_mmproj: 0,
mmproj_models: [],
created_at: '2021-01-01T00:00:00Z', created_at: '2021-01-01T00:00:00Z',
readme: readme:
'https://huggingface.co/microsoft/DialoGPT-medium/resolve/main/README.md', 'https://huggingface.co/microsoft/DialoGPT-medium/resolve/main/README.md',
@ -820,7 +822,7 @@ describe('models service', () => {
downloads: 0, downloads: 0,
likes: 0, likes: 0,
tags: [], tags: [],
created_at: '2021-01-01T00:00:00Z', createdAt: '2021-01-01T00:00:00Z',
last_modified: '2021-12-01T00:00:00Z', last_modified: '2021-12-01T00:00:00Z',
private: false, private: false,
disabled: false, disabled: false,

View File

@ -28,7 +28,7 @@ export interface CatalogModel {
quants: ModelQuant[] quants: ModelQuant[]
mmproj_models?: MMProjModel[] mmproj_models?: MMProjModel[]
num_mmproj: number num_mmproj: number
createdAt?: string created_at?: string
readme?: string readme?: string
tools?: boolean tools?: boolean
} }
@ -205,7 +205,7 @@ export const convertHfRepoToCatalogModel = (
model_name: repo.modelId, model_name: repo.modelId,
developer: repo.author, developer: repo.author,
downloads: repo.downloads || 0, downloads: repo.downloads || 0,
createdAt: repo.createdAt, created_at: repo.createdAt,
num_quants: quants.length, num_quants: quants.length,
quants: quants, quants: quants,
num_mmproj: mmprojModels.length, num_mmproj: mmprojModels.length,