Skip to content

Commit 324e720

Browse files
author
multimodalart
committed
add props to ModelData
and lint
1 parent 66535f5 commit 324e720

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

packages/tasks/src/model-data.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ export interface ModelData {
107107
parameters?: Record<string, unknown>;
108108
};
109109
base_model?: string | string[];
110+
widget?: Array<{
111+
text: string;
112+
output?: {
113+
url: string;
114+
};
115+
}>;
116+
instance_prompt?: string;
110117
};
111118
/**
112119
* Library name

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ function get_base_diffusers_model(model: ModelData): string {
7171
}
7272

7373
function get_prompt_from_diffusers_model(model: ModelData): string {
74-
return model.cardData?.widget?.[0]?.text?.toString()
75-
?? model.cardData?.instance_prompt?.toString()
76-
?? "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k";
74+
return (
75+
model.cardData?.widget?.[0]?.text?.toString() ??
76+
model.cardData?.instance_prompt?.toString() ??
77+
"Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
78+
);
7779
}
7880

7981
export const bertopic = (model: ModelData): string[] => [

0 commit comments

Comments
 (0)