Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gemini/gemini-1.5-flash vs gemini-1.5-flash #260

Open
RyanMarten opened this issue Dec 15, 2024 · 0 comments
Open

gemini/gemini-1.5-flash vs gemini-1.5-flash #260

RyanMarten opened this issue Dec 15, 2024 · 0 comments

Comments

@RyanMarten
Copy link
Contributor

RyanMarten commented Dec 15, 2024

from datasets import Dataset
from bespokelabs import curator

ds = Dataset.from_dict({"prompt": ["Is there a way to create a Python class that represents a Person and has attributes for name and age?"]})

llm = curator.LLM(
    prompt_func=lambda row: row["prompt"],
    model_name="gemini-1.5-flash",
)

Throws

Traceback (most recent call last):
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/main.py", line 2340, in completion
    model_response = vertex_chat_completion.completion(  # type: ignore
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/llms/vertex_ai_and_google_ai_studio/gemini/vertex_and_google_ai_studio_gemini.py", line 1367, in completion
    _auth_header, vertex_project = self._ensure_access_token(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/llms/vertex_ai_and_google_ai_studio/vertex_llm_base.py", line 137, in _ensure_access_token
    self._credentials, cred_project_id = self.load_auth(
                                         ^^^^^^^^^^^^^^^
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/llms/vertex_ai_and_google_ai_studio/vertex_llm_base.py", line 45, in load_auth
    import google.auth as google_auth
ModuleNotFoundError: No module named 'google'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ryan/curator/../dcft_dump/gemini_filter.py", line 6, in <module>
    llm = curator.LLM(
          ^^^^^^^^^^^^
  File "/Users/ryan/curator/src/bespokelabs/curator/llm/llm.py", line 144, in __init__
    self._request_processor = LiteLLMOnlineRequestProcessor(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/curator/src/bespokelabs/curator/request_processor/litellm_online_request_processor.py", line 69, in __init__
    self.get_header_based_rate_limits()
  File "/Users/ryan/curator/src/bespokelabs/curator/request_processor/litellm_online_request_processor.py", line 177, in get_header_based_rate_limits
    headers = self.test_call()
              ^^^^^^^^^^^^^^^^
  File "/Users/ryan/curator/src/bespokelabs/curator/request_processor/litellm_online_request_processor.py", line 148, in test_call
    completion = litellm.completion(
                 ^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/utils.py", line 960, in wrapper
    raise e
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/utils.py", line 849, in wrapper
    result = original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/main.py", line 3059, in completion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2136, in exception_type
    raise e
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2112, in exception_type
    raise APIConnectionError(
litellm.exceptions.APIConnectionError: litellm.APIConnectionError: No module named 'google'
Traceback (most recent call last):
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/main.py", line 2340, in completion
    model_response = vertex_chat_completion.completion(  # type: ignore
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/llms/vertex_ai_and_google_ai_studio/gemini/vertex_and_google_ai_studio_gemini.py", line 1367, in completion
    _auth_header, vertex_project = self._ensure_access_token(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/llms/vertex_ai_and_google_ai_studio/vertex_llm_base.py", line 137, in _ensure_access_token
    self._credentials, cred_project_id = self.load_auth(
                                         ^^^^^^^^^^^^^^^
  File "/Users/ryan/curator/.venv/lib/python3.12/site-packages/litellm/llms/vertex_ai_and_google_ai_studio/vertex_llm_base.py", line 45, in load_auth
    import google.auth as google_auth
ModuleNotFoundError: No module named 'google'

This happened by accidentally using gemini-1.5-flash
instead of gemini/gemini-1.5-flash.

But this is not obvious from the error message.

https://docs.litellm.ai/docs/providers/vertex
https://docs.litellm.ai/docs/providers/gemini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant