Fabrice-TIERCELIN commited on
Commit
4c6de9b
·
verified ·
1 Parent(s): 55c1f16

Set this space to GPU config to make it work

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -25,6 +25,9 @@ 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/pytorch_model.pt", local_dir="tencent_HunyuanVideo/hunyuan-video-t2v-720p/vae")
26
 
27
  def initialize_model(model_path):
 
 
 
28
  args = parse_args()
29
  models_root_path = Path(model_path)
30
  if not models_root_path.exists():
@@ -45,6 +48,10 @@ def generate_video(
45
  flow_shift,
46
  embedded_guidance_scale
47
  ):
 
 
 
 
48
  seed = None if seed == -1 else seed
49
  width, height = resolution.split("x")
50
  width, height = int(width), int(height)
 
25
  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")
26
 
27
  def initialize_model(model_path):
28
+ if torch.cuda.device_count() == 0:
29
+ return None
30
+
31
  args = parse_args()
32
  models_root_path = Path(model_path)
33
  if not models_root_path.exists():
 
48
  flow_shift,
49
  embedded_guidance_scale
50
  ):
51
+ if torch.cuda.device_count() == 0:
52
+ gr.Warning('Set this space to GPU config to make it work.')
53
+ return None
54
+
55
  seed = None if seed == -1 else seed
56
  width, height = resolution.split("x")
57
  width, height = int(width), int(height)