witchEverly
commited on
Update CaptionGenerator.py
Browse files- CaptionGenerator.py +1 -2
CaptionGenerator.py
CHANGED
@@ -39,8 +39,7 @@ class CaptionGenerator:
|
|
39 |
:return: description - The description generated for the image.
|
40 |
"""
|
41 |
try:
|
42 |
-
|
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
|
|
|
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
|