Skip to content

Commit

Permalink
[FIX] Minor errors in gemini_api.py and internvl2.py. (#502)
Browse files Browse the repository at this point in the history
* [FIX] Initialize `self.response_persistent_file` to prevent Error

* [FIX] Wrong variable name in `internvl2.py`
  • Loading branch information
skyil7 authored Jan 17, 2025
1 parent 8821357 commit 721ee92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lmms_eval/models/gemini_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(
self.timeout = timeout
self.model = genai.GenerativeModel(model_version)
self.continual_mode = continual_mode
self.response_persistent_file = ""
self.interleave = interleave
# if self.continual_mode and response_persistent_folder is None:
# raise ValueError("Continual mode requires a persistent path for the response. We will cache the Gemini API response in this path and use it for future requests. Please provide a valid path.")
Expand Down
2 changes: 1 addition & 1 deletion lmms_eval/models/internvl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def generate_until(self, requests) -> List[str]:
contexts = image_tokens + "\n" + contexts
else:
pixel_values = None
num_patch_list = None
num_patches_list = None
response, history = self.model.chat(self.tokenizer, pixel_values, contexts, gen_kwargs, num_patches_list=num_patches_list, history=None, return_history=True)
elif self.modality == "video":
assert len(visuals) == 1, f"Only one video is supported, but got {len(visuals)} videos."
Expand Down

0 comments on commit 721ee92

Please sign in to comment.