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

Error when trying to use huggingface models with older version of huggingface-hub #801

Open
krassowski opened this issue May 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@krassowski
Copy link
Member

Description

#784 was released yesterday but it does not work out of the box on existing installations. When trying to get a reply I get:

[E 2024-05-22 10:26:26.680 AiExtension] InferenceClient.post() got an unexpected keyword argument 'stream'

I would wager that this is because a specific version of huggingface_hub is needed, but there is no pin on version as of now: huggingface_hub

Reproduce

huggingface-hub               0.15.1
jupyter_ai                    2.16.0

Upgrading huggingface-hub to 0.23.1 fixes the problem.

Expected behavior

  • Version pin is added so that installs get the new version installed
  • Maybe a version warning is shown if the dependency version is too old? Not sure.
@krassowski krassowski added the bug Something isn't working label May 22, 2024
@dlqqq
Copy link
Member

dlqqq commented May 31, 2024

@krassowski Thank you for documenting this! The huggingface_hub dependency is listed in the [all] optional dependency group, as we keep all of our model provider dependencies optional to minimize conflicts with a user's environment.

To install & upgrade all optional dependencies, you should be able to run:

pip install -U "jupyter_ai[all]"

I agree that we should both 1) add version ranges to each provider's declared dependencies, and 2) somehow check in the backend both a) whether the package is installed, and b) whether the package meets the version range, if specified.

2.a) is tracked in #680. Most ImportErrors raised by LangChain are caught and returned as an error message in the chat, but there seem to be edge cases that require further investigation. 1) and 2.b) are not implemented. I had explored this route, but ran into difficulties reliably getting the version of a package.

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
None yet
Development

No branches or pull requests

2 participants