Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remote model added manually does not shown in model drop down #3261

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
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 electron/resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0-7
0.5.0-27
17 changes: 12 additions & 5 deletions web/hooks/useGetModelsByEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
namchuai marked this conversation as resolved.
Show resolved Hide resolved
models.push(entryModel)
}

return models.filter((m) => {
Expand Down
1 change: 0 additions & 1 deletion web/hooks/useModelHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
3 changes: 0 additions & 3 deletions web/utils/thread.ts

This file was deleted.

Loading