Spaces:
Runtime error
Runtime error
Commit
•
8abdcd2
1
Parent(s):
910652f
Update app.py
Browse files
app.py
CHANGED
@@ -82,7 +82,7 @@ def bot_streaming(message, history):
|
|
82 |
conv.append_message(conv.roles[1], None)
|
83 |
prompt = conv.get_prompt()
|
84 |
|
85 |
-
image = Image.open(
|
86 |
image_tensor = image_processor([image], image_processor, self.model_config)[0]
|
87 |
|
88 |
inputs = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt')
|
@@ -112,10 +112,10 @@ chat_input = gr.MultimodalTextbox(interactive=True, file_types=["image"], placeh
|
|
112 |
with gr.Blocks(fill_height=True, ) as demo:
|
113 |
gr.ChatInterface(
|
114 |
fn=bot_streaming,
|
115 |
-
title="
|
116 |
-
examples=[{"text": "What is on the flower?", "files": ["./bee.jpg"]},
|
117 |
-
|
118 |
-
description="Try [
|
119 |
stop_btn="Stop Generation",
|
120 |
multimodal=True,
|
121 |
textbox=chat_input,
|
|
|
82 |
conv.append_message(conv.roles[1], None)
|
83 |
prompt = conv.get_prompt()
|
84 |
|
85 |
+
image = Image.open(image).convert('RGB')
|
86 |
image_tensor = image_processor([image], image_processor, self.model_config)[0]
|
87 |
|
88 |
inputs = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt')
|
|
|
112 |
with gr.Blocks(fill_height=True, ) as demo:
|
113 |
gr.ChatInterface(
|
114 |
fn=bot_streaming,
|
115 |
+
title="DenseConnector-v1.5-8B",
|
116 |
+
# examples=[{"text": "What is on the flower?", "files": ["./bee.jpg"]},
|
117 |
+
# {"text": "How to make this pastry?", "files": ["./baklava.png"]}],
|
118 |
+
description="Try [DenseConnector-v1.5-8B](https://huggingface.co/HuanjinYao/DenseConnector-v1.5-8B). Upload an image and start chatting about it, or simply try one of the examples below. If you don't upload an image, you will receive an error.",
|
119 |
stop_btn="Stop Generation",
|
120 |
multimodal=True,
|
121 |
textbox=chat_input,
|