stzhao commited on
Commit
7a858c7
·
verified ·
1 Parent(s): caf412f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -35,7 +35,7 @@ def load_models():
35
 
36
  model, tokenizer, pipe = load_models()
37
 
38
- @spaces.GPU
39
  def generate_enhanced_caption(image_caption, text_caption):
40
  """Generate enhanced caption using the LeX-Enhancer model"""
41
  combined_caption = f"{image_caption}, with the text on it: {text_caption}."
@@ -66,7 +66,7 @@ Below is the simple caption of an image with text. Please deduce the detailed de
66
 
67
  return combined_caption, enhanced_caption
68
 
69
- @spaces.GPU
70
  def generate_image(enhanced_caption, seed, num_inference_steps, guidance_scale):
71
  """Generate image using LeX-Lumina"""
72
  generator = torch.Generator("cpu").manual_seed(seed) if seed != 0 else None
 
35
 
36
  model, tokenizer, pipe = load_models()
37
 
38
+ @spaces.GPU(duration=100)
39
  def generate_enhanced_caption(image_caption, text_caption):
40
  """Generate enhanced caption using the LeX-Enhancer model"""
41
  combined_caption = f"{image_caption}, with the text on it: {text_caption}."
 
66
 
67
  return combined_caption, enhanced_caption
68
 
69
+ @spaces.GPU(duration=100)
70
  def generate_image(enhanced_caption, seed, num_inference_steps, guidance_scale):
71
  """Generate image using LeX-Lumina"""
72
  generator = torch.Generator("cpu").manual_seed(seed) if seed != 0 else None