🐛fix: Jan-nano repo name changed (#5274)

This commit is contained in:
Louis 2025-06-15 11:17:41 +07:00 committed by GitHub
parent c896398fab
commit 9ab69b157b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 5 deletions

View File

@ -1,7 +1,7 @@
[
{
"author": "Menlo",
"id": "Menlo/Jan-nano",
"id": "Menlo/Jan-nano-gguf",
"metadata": {
"_id": "68492cd9cada68b1d11ca1bd",
"author": "Menlo",
@ -23,11 +23,11 @@
"quantize_imatrix_file": "imatrix.dat",
"total": 4022468096
},
"id": "Menlo/Jan-nano",
"id": "Menlo/Jan-nano-gguf",
"lastModified": "2025-06-13T16:57:55.000Z",
"likes": 3,
"model-index": null,
"modelId": "Menlo/Jan-nano",
"modelId": "Menlo/Jan-nano-gguf",
"pipeline_tag": "text-generation",
"private": false,
"sha": "a04aab0878648d8f284c63a52664a482ead16f06",

View File

@ -28,7 +28,7 @@ type Data<T> = {
/**
* Defaul mode sources
*/
const defaultModelSources = ['Menlo/Jan-nano']
const defaultModelSources = ['Menlo/Jan-nano-gguf']
/**
* A extension for models
@ -291,6 +291,8 @@ export default class JanModelExtension extends ModelExtension {
const sources = await this.apiInstance()
.then((api) => api.get('v1/models/sources').json<Data<ModelSource>>())
.then((e) => (typeof e === 'object' ? (e.data as ModelSource[]) : []))
// Deprecated source - filter out from legacy sources
.then((e) => e.filter((x) => x.id.toLowerCase() !== 'menlo/jan-nano'))
.catch(() => [])
return sources.concat(
DEFAULT_MODEL_SOURCES.filter((e) => !sources.some((x) => x.id === e.id))

View File

@ -199,7 +199,8 @@ function Hub() {
const navigate = useNavigate()
const isRecommendedModel = useCallback((modelId: string) => {
return (extractModelName(modelId) === 'Jan-nano') as boolean
return (extractModelName(modelId)?.toLowerCase() ===
'jan-nano-gguf') as boolean
}, [])
const handleUseModel = useCallback(