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