Skip to content

Commit a66d0f7

Browse files
committed
safeguard for bad vision input
1 parent 9d5efd6 commit a66d0f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

koboldcpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1905,7 +1905,7 @@ def transform_genparams(genparams, api_format):
19051905
if item['type']=="text":
19061906
messages_string += item['text']
19071907
elif item['type']=="image_url":
1908-
if item['image_url'] and item['image_url']['url'] and item['image_url']['url'].startswith("data:image"):
1908+
if 'image_url' in item and item['image_url'] and item['image_url']['url'] and item['image_url']['url'].startswith("data:image"):
19091909
images_added.append(item['image_url']['url'].split(",", 1)[1])
19101910
# If last message, add any tools calls after message content and before message end token if any
19111911
if message['role'] == "user" and message_index == len(messages_array):

0 commit comments

Comments
 (0)