Update app.py
Browse files
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
|
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
|
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)
|