Skip to content

Commit 690e143

Browse files
lawrence-cjVaibhavs10Wauplin
authored
Add Sana .pth files into download counting in huggingface repo (#1061)
Co-authored-by: vb <[email protected]> Co-authored-by: Lucain <[email protected]> Co-authored-by: Lucain <[email protected]>
1 parent 32365c0 commit 690e143

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

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

+20
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,26 @@ IWorker engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, model);
982982
`,
983983
];
984984

985+
export const sana = (model: ModelData): string[] => [
986+
`
987+
# Load the model and infer image from text
988+
import torch
989+
from app.sana_pipeline import SanaPipeline
990+
from torchvision.utils import save_image
991+
992+
sana = SanaPipeline("configs/sana_config/1024ms/Sana_1600M_img1024.yaml")
993+
sana.from_pretrained("hf://${model.id}")
994+
995+
image = sana(
996+
prompt='a cyberpunk cat with a neon sign that says "Sana"',
997+
height=1024,
998+
width=1024,
999+
guidance_scale=5.0,
1000+
pag_guidance_scale=2.0,
1001+
num_inference_steps=18,
1002+
) `,
1003+
];
1004+
9851005
export const vfimamba = (model: ModelData): string[] => [
9861006
`from Trainer_finetune import Model
9871007

packages/tasks/src/model-libraries.ts

+7
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
787787
filter: true,
788788
countDownloads: `path_extension:"sentis"`,
789789
},
790+
sana: {
791+
prettyLabel: "Sana",
792+
repoName: "Sana",
793+
repoUrl: "https://github.com/NVlabs/Sana",
794+
countDownloads: `path_extension:"pth"`,
795+
snippets: snippets.sana,
796+
},
790797
"vfi-mamba": {
791798
prettyLabel: "VFIMamba",
792799
repoName: "VFIMamba",

0 commit comments

Comments
 (0)