Skip to content

Commit 1ca1ce5

Browse files
[Fix] Only apply use_vllm flag to llama4
1 parent c0298cc commit 1ca1ce5

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

vlmeval/inference.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ def infer_data(model, model_name, work_dir, dataset, out_file, verbose=False, ap
107107
data = data[~data['index'].isin(res)]
108108
lt = len(data)
109109

110-
model = supported_VLM[model_name](use_vllm=use_vllm) if isinstance(model, str) else model
110+
kwargs = {}
111+
if model_name is not None and 'Llama-4' in model_name:
112+
kwargs = {'use_vllm': use_vllm}
113+
model = supported_VLM[model_name](**kwargs) if isinstance(model, str) else model
111114

112115
is_api = getattr(model, 'is_api', False)
113116
if is_api:

vlmeval/inference_mt.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ def infer_data(model, model_name, work_dir, dataset, out_file, verbose=False, ap
101101
data = data[~data['index'].isin(res)]
102102
lt = len(data)
103103

104-
model = supported_VLM[model_name](use_vllm=use_vllm) if isinstance(model, str) else model
104+
kwargs = {}
105+
if model_name is not None and 'Llama-4' in model_name:
106+
kwargs = {'use_vllm': use_vllm}
107+
model = supported_VLM[model_name](**kwargs) if isinstance(model, str) else model
105108
assert hasattr(model, 'chat_inner')
106109

107110
is_api = getattr(model, 'is_api', False)

vlmeval/inference_video.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ def infer_data(model, model_name, work_dir, dataset, out_file, verbose=False, ap
6161
if np.all([idx in res for idx in sample_indices_sub]):
6262
return model
6363
sample_indices_subrem = [x for x in sample_indices_sub if x not in res]
64-
model = supported_VLM[model_name](use_vllm=use_vllm) if isinstance(model, str) else model
64+
65+
kwargs = {}
66+
if model_name is not None and 'Llama-4' in model_name:
67+
kwargs = {'use_vllm': use_vllm}
68+
model = supported_VLM[model_name](**kwargs) if isinstance(model, str) else model
6569

6670
is_api = getattr(model, 'is_api', False)
6771
if is_api:

0 commit comments

Comments
 (0)