hysts HF staff commited on
Commit
f10dc54
1 Parent(s): 833a666
Files changed (2) hide show
  1. app.py +2 -0
  2. requirements.txt +3 -2
app.py CHANGED
@@ -9,6 +9,7 @@ import tempfile
9
  import gradio as gr
10
  import imageio
11
  import numpy as np
 
12
  import torch
13
  from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
14
 
@@ -48,6 +49,7 @@ def to_video(frames: list[np.ndarray], fps: int) -> str:
48
  return out_file.name
49
 
50
 
 
51
  def generate(prompt: str, seed: int, num_frames: int,
52
  num_inference_steps: int) -> str:
53
  generator = torch.Generator().manual_seed(seed)
 
9
  import gradio as gr
10
  import imageio
11
  import numpy as np
12
+ import spaces
13
  import torch
14
  from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
15
 
 
49
  return out_file.name
50
 
51
 
52
+ @spaces.GPU
53
  def generate(prompt: str, seed: int, num_frames: int,
54
  num_inference_steps: int) -> str:
55
  generator = torch.Generator().manual_seed(seed)
requirements.txt CHANGED
@@ -3,6 +3,7 @@ diffusers==0.18.2
3
  gradio==3.36.1
4
  huggingface-hub==0.16.4
5
  imageio[ffmpeg]==2.31.1
6
- torch==2.0.1
7
- torchvision==0.15.2
 
8
  transformers==4.30.2
 
3
  gradio==3.36.1
4
  huggingface-hub==0.16.4
5
  imageio[ffmpeg]==2.31.1
6
+ spaces==0.7.0
7
+ torch==2.0.0
8
+ torchvision==0.15.1
9
  transformers==4.30.2