tchoudha21 commited on
Commit
38d216d
·
verified ·
1 Parent(s): 0a6b871

Updated README for inference code

Browse files
Files changed (1) hide show
  1. README.md +20 -1
README.md CHANGED
@@ -5,7 +5,26 @@ tags:
5
  - pytorch
6
  library_name: transformers
7
  ---
8
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  ![Cosmos Logo](https://github.com/NVIDIA/Cosmos/raw/main/assets/cosmos-logo.png)
10
 
11
  --------------------------------------------------------------------------------
 
5
  - pytorch
6
  library_name: transformers
7
  ---
8
+ ## How to Use
9
+
10
+ ```python
11
+ from transformers import AutoModel
12
+ model = AutoModel.from_pretrained(
13
+ "Nvidia-CMU25/DiffusionVideo2WorldGeneration",
14
+ cache_dir="./cache",
15
+ trust_remote_code=True,
16
+ # force_download=True,
17
+ # turn on offloading on a low GPU memory machine:
18
+ # offload_network=True,
19
+ # offload_tokenizer=True,
20
+ # offload_text_encoder_model=True,
21
+ # offload_prompt_upsampler=True,
22
+ # offload_guardrail_models=True,
23
+ )
24
+ prompt = "Some text prompt to generate a video"
25
+ input_image_or_video_path = "path/to/image.jpeg"
26
+ model(prompt, input_image_or_video_path)
27
+ ```
28
  ![Cosmos Logo](https://github.com/NVIDIA/Cosmos/raw/main/assets/cosmos-logo.png)
29
 
30
  --------------------------------------------------------------------------------