zR commited on
Commit
3fe1a1d
1 Parent(s): 61d1222

numpy problem

Browse files
Files changed (2) hide show
  1. app.py +3 -1
  2. requirements.txt +1 -1
app.py CHANGED
@@ -4,10 +4,12 @@ import time
4
 
5
  import gradio as gr
6
  import torch
 
7
  from diffusers import CogVideoXPipeline
8
  from diffusers.utils import export_to_video
9
  from datetime import datetime, timedelta
10
  from openai import OpenAI
 
11
  import moviepy.editor as mp
12
 
13
  dtype = torch.float16
@@ -80,7 +82,7 @@ def convert_prompt(prompt: str, retry_times: int = 3) -> str:
80
  return response.choices[0].message.content
81
  return prompt
82
 
83
-
84
  def infer(prompt: str, num_inference_steps: int, guidance_scale: float, progress=gr.Progress(track_tqdm=True)):
85
  torch.cuda.empty_cache()
86
  video = pipe(
 
4
 
5
  import gradio as gr
6
  import torch
7
+ import sap
8
  from diffusers import CogVideoXPipeline
9
  from diffusers.utils import export_to_video
10
  from datetime import datetime, timedelta
11
  from openai import OpenAI
12
+ import spaces
13
  import moviepy.editor as mp
14
 
15
  dtype = torch.float16
 
82
  return response.choices[0].message.content
83
  return prompt
84
 
85
+ @spaces.GPU(duration=240)
86
  def infer(prompt: str, num_inference_steps: int, guidance_scale: float, progress=gr.Progress(track_tqdm=True)):
87
  torch.cuda.empty_cache()
88
  video = pipe(
requirements.txt CHANGED
@@ -8,4 +8,4 @@ spaces==0.29.2
8
  moviepy==1.0.3
9
  openai==1.42.0
10
  git+https://github.com/huggingface/accelerate.git@main#egg=accelerate
11
- sentencepiece==0.2.0
 
8
  moviepy==1.0.3
9
  openai==1.42.0
10
  git+https://github.com/huggingface/accelerate.git@main#egg=accelerate
11
+ sentencepiece==0.2.0