Skip to content

Commit

Permalink
Fix GeminiV
Browse files Browse the repository at this point in the history
  • Loading branch information
kennymckormick committed Apr 3, 2024
1 parent 6c91e04 commit fb77f55
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions vlmeval/api/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ def build_msgs(self, inputs):

def generate_inner(self, inputs, **kwargs) -> str:
import google.generativeai as genai
assert isinstance(inputs, str) or isinstance(inputs, list)
pure_text = True
if isinstance(inputs, list):
for pth in inputs:
if osp.exists(pth) or pth.startswith('http'):
pure_text = False
assert isinstance(inputs, list)
pure_text = np.all([x['type'] == 'text' for x in inputs])
genai.configure(api_key=self.api_key)
model = genai.GenerativeModel('gemini-pro') if pure_text else genai.GenerativeModel('gemini-pro-vision')
messages = self.build_msgs(inputs)
Expand Down

0 comments on commit fb77f55

Please sign in to comment.