Skip to content

Commit dd4fbd9

Browse files
jenjsunpcuenca
andauthored
Add VideoPrism as library (#1581)
This adds VideoPrism so that download stats are tracked Relevant links: google-deepmind/videoprism#10 https://huggingface.co/google/videoprism --------- Co-authored-by: Pedro Cuenca <[email protected]>
1 parent 7087d29 commit dd4fbd9

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
@@ -1542,6 +1542,20 @@ image = sana(
15421542
) `,
15431543
];
15441544

1545+
export const videoprism = (model: ModelData): string[] => [
1546+
`# Install from https://github.com/google-deepmind/videoprism
1547+
import jax
1548+
import jax.numpy as jnp
1549+
from videoprism import models as vp
1550+
1551+
flax_model = vp.MODELS["${model.id}"]()
1552+
loaded_state = vp.load_pretrained_weights("${model.id}")
1553+
1554+
@jax.jit
1555+
def forward_fn(inputs, train=False):
1556+
return flax_model.apply(loaded_state, inputs, train=train)`,
1557+
];
1558+
15451559
export const vfimamba = (model: ModelData): string[] => [
15461560
`from Trainer_finetune import Model
15471561

packages/tasks/src/model-libraries.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
10931093
countDownloads: `path_extension:"pth"`,
10941094
snippets: snippets.sana,
10951095
},
1096+
videoprism: {
1097+
prettyLabel: "VideoPrism",
1098+
repoName: "VideoPrism",
1099+
repoUrl: "https://github.com/google-deepmind/videoprism",
1100+
countDownloads: `path_extension:"npz"`,
1101+
snippets: snippets.videoprism,
1102+
},
10961103
"vfi-mamba": {
10971104
prettyLabel: "VFIMamba",
10981105
repoName: "VFIMamba",

0 commit comments

Comments
 (0)