HuanjinYao commited on
Commit
8abdcd2
1 Parent(s): 910652f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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(os.path.join(image, image_file)).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,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="LLaVA Llama-3-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 [LLaVA Llama-3-8B](https://huggingface.co/xtuner/llava-llama-3-8b-v1_1-transformers). 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,
 
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,