From 8eb20929217feed91097f60460802f6c6ba7b92b Mon Sep 17 00:00:00 2001 From: marko1616 <45327989+marko1616@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:24:34 +0800 Subject: [PATCH] Update chat.py --- src/llamafactory/api/chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llamafactory/api/chat.py b/src/llamafactory/api/chat.py index 1010aab1..5bad1af2 100644 --- a/src/llamafactory/api/chat.py +++ b/src/llamafactory/api/chat.py @@ -17,7 +17,7 @@ import io import json import os import uuid -import numpy +import numpy as np from typing import TYPE_CHECKING, AsyncGenerator, Dict, List, Optional, Tuple from ..data import Role as DataRole @@ -113,7 +113,7 @@ def _process_request( else: # web uri 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: input_messages.append({"role": ROLE_MAPPING[message.role], "content": message.content})