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

[BUG] Open AI dependency breaks tracing notebook #1717

Closed
amank94 opened this issue Nov 7, 2023 · 1 comment
Closed

[BUG] Open AI dependency breaks tracing notebook #1717

amank94 opened this issue Nov 7, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@amank94
Copy link
Contributor

amank94 commented Nov 7, 2023

Describe the bug
Tracing notebook broken by Open pip install statement

https://colab.research.google.com/github/Arize-ai/phoenix/blob/main/tutorials/tracing/llama_index_tracing_tutorial.ipynb#scrollTo=s79awESrkJWs

Trace below:

ModuleNotFoundError                       Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/phoenix/experimental/evals/models/openai.py](https://localhost:8080/#) in _init_environment(self)
     73             import openai
---> 74             import openai.util
     75             from openai import error as openai_error

ModuleNotFoundError: No module named 'openai.util'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
4 frames
[<ipython-input-14-7a501fa723d4>](https://localhost:8080/#) in <cell line: 3>()
      1 get_ipython().system('pip install openai>=0.26.4')
      2 
----> 3 model = OpenAIModel(
      4     model_name="gpt-4",
      5     temperature=0.0,

/usr/local/lib/python3.10/dist-packages/phoenix/experimental/evals/models/openai.py in __init__(self, _verbose, openai_api_type, openai_api_version, openai_api_key, openai_api_base, openai_organization, engine, model_name, temperature, max_tokens, top_p, frequency_penalty, presence_penalty, n, model_kwargs, batch_size, request_timeout, max_retries, retry_min_seconds, retry_max_seconds)

[/usr/local/lib/python3.10/dist-packages/phoenix/experimental/evals/models/openai.py](https://localhost:8080/#) in __post_init__(self)
     65 
     66     def __post_init__(self) -> None:
---> 67         self._init_environment()
     68         self._init_open_ai()
     69         self._init_tiktoken()

[/usr/local/lib/python3.10/dist-packages/phoenix/experimental/evals/models/openai.py](https://localhost:8080/#) in _init_environment(self)
     79             self._openai_util = openai.util
     80         except ImportError:
---> 81             self._raise_import_error(
     82                 package_display_name="OpenAI",
     83                 package_name="openai",

[/usr/local/lib/python3.10/dist-packages/phoenix/experimental/evals/models/base.py](https://localhost:8080/#) in _raise_import_error(package_name, package_display_name, package_min_version)
    178         else:
    179             msg += f"`pip install {package_name}`."
--> 180         raise ImportError(msg)
    181 
    182     @abstractmethod

ImportError: Could not import necessary dependencies to use OpenAI. Please install them with `pip install openai>=0.26.4`.

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
@amank94 amank94 added bug Something isn't working triage issues that need triage labels Nov 7, 2023
@mikeldking mikeldking removed the triage issues that need triage label Nov 7, 2023
@mikeldking
Copy link
Contributor

Thanks for filing this issue @amank94 - We didn't anticipate the release of OpenAI 1.0 during dev day and as such all notebooks automatically migrated to the latest which has breaking changes. For the time being Phoenix only supports OpenAI pre 1.0 but will migrate as part of #1716

The notebooks have been pinned via #1718 and should work out of the box. Thanks for your patience.

@mikeldking mikeldking self-assigned this Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants