Update app.py
Browse files
app.py
CHANGED
@@ -78,6 +78,7 @@ Below is the simple caption of an image with text. Please deduce the detailed de
|
|
78 |
@spaces.GPU(duration=60)
|
79 |
def generate_image(enhanced_caption, seed, num_inference_steps, guidance_scale):
|
80 |
pipe.to("cuda")
|
|
|
81 |
"""Generate image using LeX-Lumina"""
|
82 |
# Truncate the caption if it's too long
|
83 |
enhanced_caption = truncate_caption_by_tokens(enhanced_caption, max_tokens=256)
|
|
|
78 |
@spaces.GPU(duration=60)
|
79 |
def generate_image(enhanced_caption, seed, num_inference_steps, guidance_scale):
|
80 |
pipe.to("cuda")
|
81 |
+
pipe.enable_model_cpu_offload()
|
82 |
"""Generate image using LeX-Lumina"""
|
83 |
# Truncate the caption if it's too long
|
84 |
enhanced_caption = truncate_caption_by_tokens(enhanced_caption, max_tokens=256)
|