Update app.py
Browse files
app.py
CHANGED
@@ -55,7 +55,8 @@ def generate_caption_and_image(image):
|
|
55 |
selected_pattern = random.choice(patterns)
|
56 |
selected_textile_design = random.choice(textile_designs)
|
57 |
|
58 |
-
|
|
|
59 |
|
60 |
pixel_values = feature_extractor(images=[img], return_tensors="pt").pixel_values.to(device)
|
61 |
output_ids = model.generate(pixel_values, **gen_kwargs)
|
|
|
55 |
selected_pattern = random.choice(patterns)
|
56 |
selected_textile_design = random.choice(textile_designs)
|
57 |
|
58 |
+
gen_kwargs = {"max_length": 16, "num_beams": 4}
|
59 |
+
|
60 |
|
61 |
pixel_values = feature_extractor(images=[img], return_tensors="pt").pixel_values.to(device)
|
62 |
output_ids = model.generate(pixel_values, **gen_kwargs)
|