Fiqa commited on
Commit
4ea2dd5
·
verified ·
1 Parent(s): 0372f7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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)