fix: switching loader from remote to local model from thread right panel

This commit is contained in:
Faisal Amir 2024-01-22 10:42:22 +07:00
parent 612445b4fa
commit a3f2a16cb4

View File

@ -55,8 +55,6 @@ export default function DropdownListSidebar() {
const { recommendedModel, downloadedModels } = useRecommendedModel()
const selectedName =
downloadedModels.filter((x) => x.id === selectedModel?.id)[0]?.name ?? ''
/**
* Default value for max_tokens and ctx_len
* Its to avoid OOM issue since a model can set a big number for these settings
@ -67,7 +65,7 @@ export default function DropdownListSidebar() {
}
useEffect(() => {
setSelectedModel(activeModel || recommendedModel)
setSelectedModel(selectedModel || activeModel || recommendedModel)
if (activeThread) {
const finishInit = threadStates[activeThread.id].isFinishInit ?? true
@ -148,7 +146,6 @@ export default function DropdownListSidebar() {
serverEnabled,
activeThreadId,
activeModel,
setSelectedModel,
setThreadModelParams,
]
)
@ -180,7 +177,7 @@ export default function DropdownListSidebar() {
stateModel.loading && 'font-medium'
)}
>
{selectedName}
{selectedModel?.name}
</span>
</SelectValue>
</SelectTrigger>