Update modeling_GOT.py
Browse files- modeling_GOT.py +6 -6
modeling_GOT.py
CHANGED
@@ -469,13 +469,13 @@ class GOTQwenForCausalLM(Qwen2ForCausalLM):
|
|
469 |
config.im_start_token, config.im_end_token = 151857, 151858
|
470 |
|
471 |
def load_image(self, image_file):
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
|
478 |
-
image = image_file
|
479 |
return image
|
480 |
|
481 |
def disable_torch_init(self):
|
|
|
469 |
config.im_start_token, config.im_end_token = 151857, 151858
|
470 |
|
471 |
def load_image(self, image_file):
|
472 |
+
if image_file.startswith('http') or image_file.startswith('https'):
|
473 |
+
response = requests.get(image_file)
|
474 |
+
image = Image.open(BytesIO(response.content)).convert('RGB')
|
475 |
+
else:
|
476 |
+
image = Image.open(image_file).convert('RGB')
|
477 |
|
478 |
+
# image = image_file
|
479 |
return image
|
480 |
|
481 |
def disable_torch_init(self):
|