AustingDong
commited on
Commit
·
9a42c30
1
Parent(s):
9d76fc2
utilize llava 1.5
Browse files- app.py +3 -3
- demo/model_utils.py +2 -2
app.py
CHANGED
@@ -114,8 +114,8 @@ def multimodal_understanding(model_type,
|
|
114 |
start = 620
|
115 |
elif model_name.split('-')[0] == "ChartGemma":
|
116 |
start = 1024
|
117 |
-
|
118 |
-
start =
|
119 |
|
120 |
if activation_map_method == "GradCAM":
|
121 |
# target_layers = vl_gpt.vision_model.vision_tower.blocks
|
@@ -286,7 +286,7 @@ with gr.Blocks() as demo:
|
|
286 |
activation_map_output = gr.Gallery(label="activation Map", height=300, columns=1)
|
287 |
|
288 |
with gr.Column():
|
289 |
-
model_selector = gr.Dropdown(choices=["Clip", "ChartGemma-3B", "Janus-1B", "Janus-7B", "LLaVA-
|
290 |
response_type = gr.Dropdown(choices=["Visualization only"], value="Visualization only", label="response_type")
|
291 |
focus = gr.Dropdown(choices=["Visual Encoder"], value="Visual Encoder", label="focus")
|
292 |
activation_map_method = gr.Dropdown(choices=["GradCAM"], value="GradCAM", label="activation map type")
|
|
|
114 |
start = 620
|
115 |
elif model_name.split('-')[0] == "ChartGemma":
|
116 |
start = 1024
|
117 |
+
elif model_name.split('-')[0] == "LLaVA":
|
118 |
+
start = 581
|
119 |
|
120 |
if activation_map_method == "GradCAM":
|
121 |
# target_layers = vl_gpt.vision_model.vision_tower.blocks
|
|
|
286 |
activation_map_output = gr.Gallery(label="activation Map", height=300, columns=1)
|
287 |
|
288 |
with gr.Column():
|
289 |
+
model_selector = gr.Dropdown(choices=["Clip", "ChartGemma-3B", "Janus-1B", "Janus-7B", "LLaVA-1.5-7B"], value="Clip", label="model")
|
290 |
response_type = gr.Dropdown(choices=["Visualization only"], value="Visualization only", label="response_type")
|
291 |
focus = gr.Dropdown(choices=["Visual Encoder"], value="Visual Encoder", label="focus")
|
292 |
activation_map_method = gr.Dropdown(choices=["GradCAM"], value="GradCAM", label="activation map type")
|
demo/model_utils.py
CHANGED
@@ -119,8 +119,8 @@ class LLaVA_Utils(Model_Utils):
|
|
119 |
|
120 |
def init_LLaVA(self):
|
121 |
|
122 |
-
|
123 |
-
model_path = "llava-hf/llava-v1.6-vicuna-7b-hf"
|
124 |
config = AutoConfig.from_pretrained(model_path)
|
125 |
|
126 |
self.vl_gpt = LlavaNextForConditionalGeneration.from_pretrained(model_path,
|
|
|
119 |
|
120 |
def init_LLaVA(self):
|
121 |
|
122 |
+
model_path = "llava-hf/llava-1.5-7b-hf"
|
123 |
+
# model_path = "llava-hf/llava-v1.6-vicuna-7b-hf"
|
124 |
config = AutoConfig.from_pretrained(model_path)
|
125 |
|
126 |
self.vl_gpt = LlavaNextForConditionalGeneration.from_pretrained(model_path,
|