stzhao commited on
Commit
c29c340
·
verified ·
1 Parent(s): 2092a85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -41,7 +41,7 @@ def truncate_caption_by_tokens(caption, max_tokens=256):
41
  return caption
42
 
43
  @spaces.GPU(duration=200)
44
- def generate_enhanced_caption(image_caption, text_caption, progress=gr.Progress(track_tqdm=True)):
45
  """Generate enhanced caption using the LeX-Enhancer model"""
46
  combined_caption = f"{image_caption}, with the text on it: {text_caption}."
47
  instruction = """
@@ -74,7 +74,7 @@ Below is the simple caption of an image with text. Please deduce the detailed de
74
  return combined_caption, enhanced_caption
75
 
76
  @spaces.GPU(duration=200)
77
- def generate_image(enhanced_caption, seed, num_inference_steps, guidance_scale, progress=gr.Progress(track_tqdm=True)):
78
  """Generate image using LeX-Lumina"""
79
  # Truncate the caption if it's too long
80
  enhanced_caption = truncate_caption_by_tokens(enhanced_caption, max_tokens=256)
 
41
  return caption
42
 
43
  @spaces.GPU(duration=200)
44
+ def generate_enhanced_caption(image_caption, text_caption):
45
  """Generate enhanced caption using the LeX-Enhancer model"""
46
  combined_caption = f"{image_caption}, with the text on it: {text_caption}."
47
  instruction = """
 
74
  return combined_caption, enhanced_caption
75
 
76
  @spaces.GPU(duration=200)
77
+ def generate_image(enhanced_caption, seed, num_inference_steps, guidance_scale):
78
  """Generate image using LeX-Lumina"""
79
  # Truncate the caption if it's too long
80
  enhanced_caption = truncate_caption_by_tokens(enhanced_caption, max_tokens=256)