Spaces:
Running
Running
import torch
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ from datetime import datetime
|
|
| 6 |
import gradio as gr
|
| 7 |
import random
|
| 8 |
import spaces
|
|
|
|
| 9 |
|
| 10 |
from hyvideo.utils.file_utils import save_videos_grid
|
| 11 |
from hyvideo.config import parse_args
|
|
@@ -14,15 +15,16 @@ from hyvideo.constants import NEGATIVE_PROMPT
|
|
| 14 |
|
| 15 |
from huggingface_hub import hf_hub_download
|
| 16 |
|
| 17 |
-
|
| 18 |
-
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="
|
| 19 |
-
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="
|
| 20 |
-
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="
|
| 21 |
-
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="
|
| 22 |
-
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="hunyuan-video-t2v-720p/transformers/
|
| 23 |
-
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="hunyuan-video-t2v-720p/transformers/
|
| 24 |
-
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="hunyuan-video-t2v-720p/
|
| 25 |
-
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="hunyuan-video-t2v-720p/vae/
|
|
|
|
| 26 |
|
| 27 |
def initialize_model(model_path):
|
| 28 |
if torch.cuda.device_count() == 0:
|
|
|
|
| 6 |
import gradio as gr
|
| 7 |
import random
|
| 8 |
import spaces
|
| 9 |
+
import torch
|
| 10 |
|
| 11 |
from hyvideo.utils.file_utils import save_videos_grid
|
| 12 |
from hyvideo.config import parse_args
|
|
|
|
| 15 |
|
| 16 |
from huggingface_hub import hf_hub_download
|
| 17 |
|
| 18 |
+
if torch.cuda.device_count() > 0:
|
| 19 |
+
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="LICENSE", local_dir="tencent_HunyuanVideo")
|
| 20 |
+
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="Notice", local_dir="tencent_HunyuanVideo")
|
| 21 |
+
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="README.md", local_dir="tencent_HunyuanVideo")
|
| 22 |
+
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="config.json", local_dir="tencent_HunyuanVideo")
|
| 23 |
+
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="hunyuan-video-t2v-720p/transformers/mp_rank_00_model_states.pt", local_dir="tencent_HunyuanVideo/hunyuan-video-t2v-720p/transformers")
|
| 24 |
+
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="hunyuan-video-t2v-720p/transformers/mp_rank_00_model_states_fp8.pt", local_dir="tencent_HunyuanVideo/hunyuan-video-t2v-720p/transformers")
|
| 25 |
+
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="hunyuan-video-t2v-720p/transformers/mp_rank_00_model_states_fp8_map.pt", local_dir="tencent_HunyuanVideo/hunyuan-video-t2v-720p/transformers")
|
| 26 |
+
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="hunyuan-video-t2v-720p/vae/config.json", local_dir="tencent_HunyuanVideo/hunyuan-video-t2v-720p/vae")
|
| 27 |
+
hf_hub_download(repo_id="tencent/HunyuanVideo", filename="hunyuan-video-t2v-720p/vae/pytorch_model.pt", local_dir="tencent_HunyuanVideo/hunyuan-video-t2v-720p/vae")
|
| 28 |
|
| 29 |
def initialize_model(model_path):
|
| 30 |
if torch.cuda.device_count() == 0:
|