mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-21 23:57:58 +01:00
API: Relax multimodal format, fixes HuggingFace Chat UI (#6353)
This commit is contained in:
parent
4c74c7a116
commit
9a150c3368
@ -154,8 +154,9 @@ def convert_history(history):
|
||||
elif item['type'] == 'text' and isinstance(item['text'], str):
|
||||
content = item['text']
|
||||
|
||||
if image_url and content:
|
||||
if image_url:
|
||||
new_history.append({"image_url": image_url, "role": "user"})
|
||||
if content:
|
||||
new_history.append({"content": content, "role": "user"})
|
||||
else:
|
||||
new_history.append(entry)
|
||||
|
Loading…
Reference in New Issue
Block a user