Merge pull request #6008 from menloresearch/hotfix/regression-issue-with-colon-in-model-name
hotfix: regression issue with colon in model name
This commit is contained in:
parent
8a7edbf3a7
commit
4bcfa84d75
@ -88,7 +88,7 @@ describe('useThreads', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
expect(Object.keys(result.current.threads)).toHaveLength(2)
|
expect(Object.keys(result.current.threads)).toHaveLength(2)
|
||||||
expect(result.current.threads['thread1'].model.id).toEqual('thread1:free')
|
expect(result.current.threads['thread1'].model.id).toEqual('thread1/free')
|
||||||
expect(result.current.threads['thread1'].model.provider).toEqual('llamacpp')
|
expect(result.current.threads['thread1'].model.provider).toEqual('llamacpp')
|
||||||
expect(result.current.threads['thread2'].model.id).toEqual('thread2/test')
|
expect(result.current.threads['thread2'].model.id).toEqual('thread2/test')
|
||||||
expect(result.current.threads['thread2'].model.provider).toEqual('llamacpp')
|
expect(result.current.threads['thread2'].model.provider).toEqual('llamacpp')
|
||||||
|
|||||||
@ -44,7 +44,9 @@ export const useThreads = create<ThreadState>()((set, get) => ({
|
|||||||
'llamacpp'
|
'llamacpp'
|
||||||
),
|
),
|
||||||
// Cortex migration: take first two parts of the ID (the last is file name which is not needed)
|
// Cortex migration: take first two parts of the ID (the last is file name which is not needed)
|
||||||
id: !thread.model?.id.endsWith(':free')
|
id:
|
||||||
|
thread.model.provider === 'llama.cpp' ||
|
||||||
|
thread.model.provider === 'llamacpp'
|
||||||
? thread.model?.id.split(':').slice(0, 2).join(sep())
|
? thread.model?.id.split(':').slice(0, 2).join(sep())
|
||||||
: thread.model?.id,
|
: thread.model?.id,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user