Spaces:
Runtime error
Runtime error
Commit
•
a637de1
1
Parent(s):
3d5381d
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,7 @@ from dc.model import *
|
|
15 |
from dc.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
|
16 |
from dc.conversation import conv_templates, SeparatorStyle
|
17 |
from PIL import Image
|
|
|
18 |
|
19 |
|
20 |
PLACEHOLDER = """
|
@@ -83,7 +84,7 @@ def bot_streaming(message, history):
|
|
83 |
prompt = conv.get_prompt()
|
84 |
|
85 |
image = Image.open(image).convert('RGB')
|
86 |
-
image_tensor =
|
87 |
|
88 |
inputs = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt')
|
89 |
|
|
|
15 |
from dc.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
|
16 |
from dc.conversation import conv_templates, SeparatorStyle
|
17 |
from PIL import Image
|
18 |
+
from dc.mm_utils import tokenizer_image_token, process_images, get_model_name_from_path
|
19 |
|
20 |
|
21 |
PLACEHOLDER = """
|
|
|
84 |
prompt = conv.get_prompt()
|
85 |
|
86 |
image = Image.open(image).convert('RGB')
|
87 |
+
image_tensor = process_images([image], image_processor, model.config)[0]
|
88 |
|
89 |
inputs = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt')
|
90 |
|