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

HuggingFace Hub image generation example not working #1242

Open
jtpio opened this issue Feb 12, 2025 · 1 comment
Open

HuggingFace Hub image generation example not working #1242

jtpio opened this issue Feb 12, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@jtpio
Copy link
Member

jtpio commented Feb 12, 2025

Description

Trying to run the following example notebook gives an error: https://github.com/jupyterlab/jupyter-ai/blob/main/examples/images.ipynb

Reproduce

pip install jupyterlab jupyter-ai huggingface_hub

export HUGGINGFACEHUB_API_TOKEN=abcd1234

jupyter lab

Then run the following cell in a notebook:

%%ai huggingface_hub:stabilityai/stable-diffusion-2-1 --format image
It's an astronaut with a boombox

Gives the following error:

ValueError: Task unknown has no recommended model. Please specify a model explicitly. Visit https://huggingface.co/tasks for more info.

Image

Expected behavior

It should produce an image.

Context

  • Jupyter AI 2.29.1
  • huggingface_hub==0.28.1
@jtpio jtpio added the bug Something isn't working label Feb 12, 2025
@jtpio
Copy link
Member Author

jtpio commented Feb 12, 2025

Of note, maybe it could be worth looking into switching to langchain-huggingface: https://python.langchain.com/docs/integrations/providers/huggingface/

Maybe this would help fix the deprecation warning:

FutureWarning: 'post' (from 'huggingface_hub.inference._client') is deprecated and will be removed from version '0.31.0'. Making direct POST requests to the inference server is not supported anymore. Please use task methods instead (e.g. `InferenceClient.chat_completion`)

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

1 participant