mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-23 06:12:50 +08:00
Update chat.py
Former-commit-id: 1545684c3f176a95554afa64f313f00b53a32a77
This commit is contained in:
parent
f3778f65f8
commit
53a2b16c38
@ -106,7 +106,7 @@ def _process_request(
|
||||
input_messages.append({"role": ROLE_MAPPING[message.role], "content": input_item.text})
|
||||
else:
|
||||
image_url = input_item.image_url.url
|
||||
if re.match("^data:image\/(png|jpg|jpeg|gif|bmp);base64,(.+)$", data_url):
|
||||
if re.match("^data:image\/(png|jpg|jpeg|gif|bmp);base64,(.+)$", image_url):
|
||||
image_data = base64.b64decode(image_url.split(",", maxsplit=1)[1])
|
||||
image_path = io.BytesIO(image_data)
|
||||
elif os.path.isfile(image_url): # local file
|
||||
|
Loading…
x
Reference in New Issue
Block a user