Skip to content
Merged
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
2 changes: 1 addition & 1 deletion web-app/src/services/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@
`https://huggingface.co/api/models/${cleanRepoId}?blobs=true&files_metadata=true`,
{
headers: hfToken
? {
Authorization: `Bearer ${hfToken}`,
}

Check warning on line 139 in web-app/src/services/models.ts

View workflow job for this annotation

GitHub Actions / coverage-check

137-139 lines are not covered with tests
: {},
}
)
Expand Down Expand Up @@ -198,13 +198,13 @@

// Convert mmproj files to mmproj_models format
const mmprojModels = mmprojFiles.map((file) => {
const modelId = file.rfilename.replace(/\.gguf$/i, '')

Check warning on line 201 in web-app/src/services/models.ts

View workflow job for this annotation

GitHub Actions / coverage-check

201 line is not covered with tests

return {
model_id: sanitizeModelId(modelId),
path: `https://huggingface.co/${repo.modelId}/resolve/main/${file.rfilename}`,
file_size: formatFileSize(file.size),
}

Check warning on line 207 in web-app/src/services/models.ts

View workflow job for this annotation

GitHub Actions / coverage-check

203-207 lines are not covered with tests
})

return {
Expand Down Expand Up @@ -268,38 +268,38 @@
* @returns A promise that resolves when the model download task is created.
*/
export const pullModelWithMetadata = async (
id: string,
modelPath: string,
mmprojPath?: string,
hfToken?: string
) => {
let modelSha256: string | undefined
let modelSize: number | undefined
let mmprojSha256: string | undefined
let mmprojSize: number | undefined

Check warning on line 279 in web-app/src/services/models.ts

View workflow job for this annotation

GitHub Actions / coverage-check

271-279 lines are not covered with tests

// Extract repo ID from model URL
// URL format: https://huggingface.co/{repo}/resolve/main/{filename}
const modelUrlMatch = modelPath.match(
/https:\/\/huggingface\.co\/([^/]+\/[^/]+)\/resolve\/main\/(.+)/
)

Check warning on line 285 in web-app/src/services/models.ts

View workflow job for this annotation

GitHub Actions / coverage-check

283-285 lines are not covered with tests

if (modelUrlMatch) {
const [, repoId, modelFilename] = modelUrlMatch

Check warning on line 288 in web-app/src/services/models.ts

View workflow job for this annotation

GitHub Actions / coverage-check

287-288 lines are not covered with tests

try {

Check warning on line 290 in web-app/src/services/models.ts

View workflow job for this annotation

GitHub Actions / coverage-check

290 line is not covered with tests
// Fetch real-time metadata from HuggingFace
const repoInfo = await fetchHuggingFaceRepo(repoId, hfToken)

Check warning on line 292 in web-app/src/services/models.ts

View workflow job for this annotation

GitHub Actions / coverage-check

292 line is not covered with tests

if (repoInfo?.siblings) {

Check warning on line 294 in web-app/src/services/models.ts

View workflow job for this annotation

GitHub Actions / coverage-check

294 line is not covered with tests
// Find the specific model file
const modelFile = repoInfo.siblings.find(
(file) => file.rfilename === modelFilename
)
if (modelFile?.lfs) {
modelSha256 = modelFile.lfs.sha256
modelSize = modelFile.lfs.size
}

Check warning on line 302 in web-app/src/services/models.ts

View workflow job for this annotation

GitHub Actions / coverage-check

296-302 lines are not covered with tests

// If mmproj path provided, extract its metadata too
if (mmprojPath) {
Expand Down Expand Up @@ -491,7 +491,7 @@
key: 'offload_mmproj',
title: 'Offload MMProj',
description:
'Offload multimodal projection layers to GPU',
'Offload multimodal projection model to GPU',
controller_type: 'checkbox',
controller_props: {
value: true,
Expand Down
Loading