Skip to content

Commit ac922ba

Browse files
not-lainWauplin
andauthored
add ben2 (#1179)
this pr will add ben2 model available at : https://huggingface.co/PramaLLC/BEN2 --------- Co-authored-by: Lucain <[email protected]>
1 parent 493ee5f commit ac922ba

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,20 @@ function get_prompt_from_diffusers_model(model: ModelData): string | undefined {
8383
}
8484
}
8585

86+
export const ben2 = (model: ModelData): string[] => [
87+
`import requests
88+
from PIL import Image
89+
from ben2 import AutoModel
90+
91+
url = "https://upload.wikimedia.org/wikipedia/commons/b/b6/Felis_catus-cat_on_snow.jpg"
92+
image = Image.open(requests.get(url, stream=True).raw)
93+
94+
model = AutoModel.from_pretrained("${model.id}")
95+
model.to("cuda").eval()
96+
foreground = model.inference(image)
97+
`,
98+
];
99+
86100
export const bertopic = (model: ModelData): string[] => [
87101
`from bertopic import BERTopic
88102

packages/tasks/src/model-libraries.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
109109
countDownloads: `path_extension:"pth"`,
110110
snippets: snippets.audioseal,
111111
},
112+
ben2: {
113+
prettyLabel: "BEN2",
114+
repoName: "BEN2",
115+
repoUrl: "https://github.com/PramaLLC/BEN2",
116+
snippets: snippets.ben2,
117+
filter: false,
118+
},
112119
bertopic: {
113120
prettyLabel: "BERTopic",
114121
repoName: "BERTopic",

0 commit comments

Comments
 (0)