mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-16 00:28:10 +08:00
Update chat.py
Former-commit-id: 206a16c17d253956afb96daea6f24478e17334fc
This commit is contained in:
parent
edf2e51bbc
commit
2674b42b59
@ -17,7 +17,7 @@ import io
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
import numpy
|
import numpy as np
|
||||||
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
|
||||||
@ -113,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 = numpy.array(Image.open(image_path).convert("RGB"))
|
image = np.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…
x
Reference in New Issue
Block a user