DataChad
DataChad copied to clipboard
Import error
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!
Just a quick thought: since your online app works fine and I assume it uses the same code, so the error could be due to my location. I am based in Iran and I know here sometimes this happens.