fix: remote model added manually does not shown in model drop down (#3261)
* fix: remote model added manually does not shown in model drop down * Bump cortex 0.5.0-27 in version.txt --------- Co-authored-by: Van Pham <64197333+Van-QA@users.noreply.github.com>
This commit is contained in:
parent
5e06ed8a12
commit
224ca3f7cc
@ -1 +1 @@
|
||||
0.5.0-7
|
||||
0.5.0-27
|
||||
|
||||
@ -31,14 +31,21 @@ const useGetModelsByEngine = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const availableModels = downloadedModels.filter(
|
||||
(m) => m.engine === engine
|
||||
)
|
||||
// engine is remote engine
|
||||
const data = queryClient.getQueryData(cortexHubModelsQueryKey)
|
||||
if (!data) return []
|
||||
if (!data) return availableModels
|
||||
|
||||
const modelEntries = data as HfModelEntry[]
|
||||
const models: Model[] = []
|
||||
const models: Model[] = [...availableModels]
|
||||
for (const entry of modelEntries) {
|
||||
if (entry.model && entry.engine === engine) {
|
||||
models.push(entry.model)
|
||||
}
|
||||
const entryModel = entry.model
|
||||
if (!entryModel) continue
|
||||
if (entry.engine !== engine) continue
|
||||
if (models.some((m) => m.model === entryModel.model)) continue
|
||||
models.push(entryModel)
|
||||
}
|
||||
|
||||
return models.filter((m) => {
|
||||
|
||||
@ -8,7 +8,6 @@ import {
|
||||
fetchCortexHubModels,
|
||||
} from '@/utils/huggingface'
|
||||
|
||||
// TODO: change curated models to built in models
|
||||
type CuratedModelResponse = {
|
||||
quickstart_models: QuickStartModel[]
|
||||
popular_models: CuratedModel[]
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
export const generateThreadId = (assistantId: string) => {
|
||||
return `${assistantId}_${(Date.now() / 1000).toFixed(0)}`
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user