Update dependencies and import paths

This commit is contained in:
n4ze3m
2024-02-23 23:25:17 +05:30
parent 743f8d4d36
commit 1c980c4059
38 changed files with 450 additions and 6042 deletions

View File

@@ -78,7 +78,7 @@ export const getAllModels = async () => {
}[]
}
export const deleteModel= async (model: string) => {
export const deleteModel = async (model: string) => {
const baseUrl = await getOllamaURL()
const response = await fetch(`${cleanUrl(baseUrl)}/api/delete`, {
method: "DELETE",
@@ -94,7 +94,7 @@ export const deleteModel= async (model: string) => {
return response.json()
}
export const fetchModels = async () => {
export const fetchChatModels = async () => {
try {
const baseUrl = await getOllamaURL()
const response = await fetch(`${cleanUrl(baseUrl)}/api/tags`)
@@ -102,8 +102,7 @@ export const fetchModels = async () => {
throw new Error(response.statusText)
}
const json = await response.json()
return json.models as {
const models = json.models as {
name: string
model: string
modified_at: string
@@ -118,6 +117,12 @@ export const fetchModels = async () => {
quantization_level: string
}
}[]
return models.filter((model) => {
return (
!model.details.families.includes("bert") &&
!model.details.families.includes("nomic-bert")
)
})
} catch (e) {
console.error(e)
return []