Add custom flags

This commit is contained in:
kwaroran
2024-12-03 21:34:55 +09:00
parent 9ac91190f9
commit 50d20bcc3f
4 changed files with 55 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
import type { Parameter } from "../process/request"
import { getDatabase } from "../storage/database.svelte"
export enum LLMFlags{
hasImageInput,
@@ -979,11 +980,16 @@ for(let model of LLMModels){
export function getModelInfo(id: string): LLMModel{
const found:LLMModel = LLMModels.find(model => model.id === id)
const db = getDatabase()
const found:LLMModel = safeStructuredClone(LLMModels.find(model => model.id === id))
if(found){
if(db.enableCustomFlags){
found.flags = db.customFlags
}
console.log('found', found)
if(found) return found
return found
}
if(id.startsWith('hf:::')){
const withoutPrefix = id.replace('hf:::', '')