Skip to content

Commit

Permalink
customModel length hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
benbot committed Nov 9, 2023
1 parent 26eeb54 commit 35e9e6a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/core/shared/src/nodes/text/GenerateText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ export class GenerateText extends MagickComponent<Promise<WorkerReturn>> {
]) as CompletionProvider[]

const model = (node.data as { model: string }).model as string
const customModel = (node.data as { customModel: string })
.customModel as string
const customModel = node.data.customModel as string | undefined

// get the provider for the selected model
const provider = completionProviders.find(provider =>
Expand All @@ -195,7 +194,7 @@ export class GenerateText extends MagickComponent<Promise<WorkerReturn>> {
}

// check if custom model and regex check for word fine-tune in model
if (customModel.length > 0) {
if (customModel && customModel.length > 0) {
node.data.customModel = customModel
}

Expand Down

0 comments on commit 35e9e6a

Please sign in to comment.