Skip to content

Commit

Permalink
Fix get_prompt_from_diffusers_model
Browse files Browse the repository at this point in the history
  • Loading branch information
mishig25 committed Sep 20, 2024
1 parent c488b19 commit f975978
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/tasks/src/model-libraries-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function get_base_diffusers_model(model: ModelData): string {
}

function get_prompt_from_diffusers_model(model: ModelData): string | undefined {
const prompt = (model.widgetData?.[0] as WidgetExampleTextInput).text ?? model.cardData?.instance_prompt;
const prompt = (model.widgetData?.[0] as WidgetExampleTextInput | undefined)?.text ?? model.cardData?.instance_prompt;
if (prompt) {
return escapeStringForJson(prompt);
}
Expand Down

0 comments on commit f975978

Please sign in to comment.