Skip to content

Commit 33e6316

Browse files
AndysonYsosansevieroWauplin
authored
Add SEED-Story (huggingface#820)
This PR adds https://github.com/TencentARC/SEED-Story, a multimodal story generation model, as a library. --------- Co-authored-by: Omar Sanseviero <[email protected]> Co-authored-by: Lucain <[email protected]>
1 parent 355b44c commit 33e6316

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,21 @@ sae, cfg_dict, sparsity = SAE.from_pretrained(
435435
)`,
436436
];
437437

438+
export const seed_story = (): string[] => [
439+
`# seed_story_cfg_path refers to 'https://github.com/TencentARC/SEED-Story/blob/master/configs/clm_models/agent_7b_sft.yaml'
440+
# llm_cfg_path refers to 'https://github.com/TencentARC/SEED-Story/blob/master/configs/clm_models/llama2chat7b_lora.yaml'
441+
from omegaconf import OmegaConf
442+
import hydra
443+
444+
# load Llama2
445+
llm_cfg = OmegaConf.load(llm_cfg_path)
446+
llm = hydra.utils.instantiate(llm_cfg, torch_dtype="fp16")
447+
448+
# initialize seed_story
449+
seed_story_cfg = OmegaConf.load(seed_story_cfg_path)
450+
seed_story = hydra.utils.instantiate(seed_story_cfg, llm=llm) `,
451+
];
452+
438453
const skopsPickle = (model: ModelData, modelFile: string) => {
439454
return [
440455
`import joblib

packages/tasks/src/model-libraries.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,14 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
539539
filter: false,
540540
countDownloads: `path_extension:"safetensors"`,
541541
},
542+
"seed-story": {
543+
prettyLabel: "SEED-Story",
544+
repoName: "SEED-Story",
545+
repoUrl: "https://github.com/TencentARC/SEED-Story",
546+
filter: false,
547+
countDownloads: `path:"cvlm_llama2_tokenizer/tokenizer.model"`,
548+
snippets: snippets.seed_story,
549+
},
542550
"stable-baselines3": {
543551
prettyLabel: "stable-baselines3",
544552
repoName: "stable-baselines3",

0 commit comments

Comments
 (0)