witchEverly commited on
Commit
421b1b6
·
verified ·
1 Parent(s): af66856

Update CaptionGenerator.py

Browse files
Files changed (1) hide show
  1. CaptionGenerator.py +2 -1
CaptionGenerator.py CHANGED
@@ -39,7 +39,8 @@ class CaptionGenerator:
39
  :return: description - The description generated for the image.
40
  """
41
  try:
42
- inputs = processor(images=image_data, return_tensors="pt")
 
43
  generated_ids = model.generate(**inputs, max_length=100)
44
  description = processor.batch_decode(generated_ids, skip_special_tokens=True)[0].strip()
45
  return description
 
39
  :return: description - The description generated for the image.
40
  """
41
  try:
42
+ prompt = " "
43
+ inputs = processor(images=image, text=prompt, return_tensors="pt")
44
  generated_ids = model.generate(**inputs, max_length=100)
45
  description = processor.batch_decode(generated_ids, skip_special_tokens=True)[0].strip()
46
  return description