khoj-ai / khoj

Your AI second brain. Get answers to your questions, whether they be online or in your own notes. Use online AI models (e.g gpt4) or private, local LLMs (e.g llama3). Self-host locally or use our cloud instance. Access from Obsidian, Emacs, Desktop app, Web or Whatsapp.
https://khoj.dev
GNU Affero General Public License v3.0
12.41k stars 628 forks source link

[FIX] #708

Closed alifemove closed 4 months ago

alifemove commented 4 months ago

Describe the bug

A clear and concise description of what the bug is. Please include what you were expecting to happen vs. what actually happened.

Platform

If self-hosted

khoj --anonymous-mode
Traceback (most recent call last):
  File "/Users/local/.pyenv/versions/3.11.1/bin/khoj", line 5, in <module>
    from khoj.main import run
  File "/Users/local/.pyenv/versions/3.11.1/lib/python3.11/site-packages/khoj/main.py", line 80, in <module>
    from khoj.configure import configure_routes, initialize_server, configure_middleware
  File "/Users/local/.pyenv/versions/3.11.1/lib/python3.11/site-packages/khoj/configure.py", line 23, in <module>
    from khoj.database.adapters import (
  File "/Users/-local/.pyenv/versions/3.11.1/lib/python3.11/site-packages/khoj/database/adapters/__init__.py", line 46, in <module>
    from khoj.utils import state
  File "/Users/local/.pyenv/versions/3.11.1/lib/python3.11/site-packages/khoj/utils/state.py", line 11, in <module>
    from khoj.utils import config as utils_config
  File "/Users/local/.pyenv/versions/3.11.1/lib/python3.11/site-packages/khoj/utils/config.py", line 11, in <module>
    from khoj.processor.conversation.offline.utils import download_model
  File "/Users/local/.pyenv/versions/3.11.1/lib/python3.11/site-packages/khoj/processor/conversation/offline/utils.py", line 5, in <module>
    from huggingface_hub.constants import HF_HUB_CACHE
ImportError: cannot import name 'HF_HUB_CACHE' from 'huggingface_hub.constants' (/Users/local/.pyenv/versions/3.11.1/lib/python3.11/site-packages/huggingface_hub/constants.py)
sabaimran commented 4 months ago

Hey @alifemove , your issue description says you're using docker, but the stack trace implies you're using the python package. Can you confirm that this is just happening in the python package?

alifemove commented 4 months ago

Oh sorry @sabaimran, I'm using the python package.

sabaimran commented 4 months ago

Got it, let me investigate and see what's up. Is this a first-time install, or did you upgrade? (pip install --upgrade khoj-assistant)

alifemove commented 4 months ago

Upgrade.

Looked at huggingface_hub, the constant being used is definitely there... /shrug

sabaimran commented 4 months ago

Hmm, might be the hugging face hub package also needs an upgrade. I'm not able to repro your error on a clean install of khoj v1.10.2.

alifemove commented 4 months ago

Yeah, I opened up the huggingface_hub local copy and it doesn't have that var. Python not upgrading dependencies, yay...

sabaimran commented 4 months ago

Can you run pip show huggingface-hub in your virtual environment where you're running Khoj and tell me the version of huggingface-hub? I'll upgrade our min version. Thanks for spotting & reporting this issue!

alifemove commented 4 months ago

I was able to pip install --upgrade huggingface_hub and it works now.

Successfully uninstalled huggingface-hub-0.17.3

Successfully installed huggingface_hub-0.22.2
alifemove commented 4 months ago

Thanks much. 🚀

sabaimran commented 4 months ago

Of course! Thanks for pointing it out. Always feel free to report bugs/issues/feature requests.