Skip to content

Import error #12

@aslansd

Description

@aslansd

Hi Gustav,

I built your project with Docker Desktop and ran it. However, it gives the following error:

ImportError: cannot import name 'get_openai_token_cost_for_model' from 'langchain.callbacks.openai_info' (/usr/local/lib/python3.10/site-packages/langchain/callbacks/openai_info.py)

Traceback:

File "/usr/local/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
    exec(code, module.__dict__)
File "/app/app.py", line 1, in <module>
    from datachad.streamlit.helper import init_session_state
File "/app/datachad/streamlit/helper.py", line 8, in <module>
    from langchain.callbacks.openai_info import get_openai_token_cost_for_model

I tried the solution here, but it still gives the same error.

I was wondering if you have any thought on this error. Many thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions