Update chat.py
This commit is contained in:
parent
36039b0fe0
commit
a4f1de9d82
|
@ -17,6 +17,7 @@ import io
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
import numpy
|
||||||
from typing import TYPE_CHECKING, AsyncGenerator, Dict, List, Optional, Tuple
|
from typing import TYPE_CHECKING, AsyncGenerator, Dict, List, Optional, Tuple
|
||||||
|
|
||||||
from ..data import Role as DataRole
|
from ..data import Role as DataRole
|
||||||
|
@ -112,7 +113,7 @@ def _process_request(
|
||||||
else: # web uri
|
else: # web uri
|
||||||
image_path = requests.get(image_url, stream=True).raw
|
image_path = requests.get(image_url, stream=True).raw
|
||||||
|
|
||||||
image = Image.open(image_path).convert("RGB")
|
image = numpy.array(Image.open(image_path).convert("RGB"))
|
||||||
else:
|
else:
|
||||||
input_messages.append({"role": ROLE_MAPPING[message.role], "content": message.content})
|
input_messages.append({"role": ROLE_MAPPING[message.role], "content": message.content})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue