Skip to content

Commit 8b8028a

Browse files
authored
Fix get_prompt_from_diffusers_model (#919)
Follow up to #909
1 parent c488b19 commit 8b8028a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function get_base_diffusers_model(model: ModelData): string {
7474
}
7575

7676
function get_prompt_from_diffusers_model(model: ModelData): string | undefined {
77-
const prompt = (model.widgetData?.[0] as WidgetExampleTextInput).text ?? model.cardData?.instance_prompt;
77+
const prompt = (model.widgetData?.[0] as WidgetExampleTextInput | undefined)?.text ?? model.cardData?.instance_prompt;
7878
if (prompt) {
7979
return escapeStringForJson(prompt);
8080
}

0 commit comments

Comments
 (0)