jupyter-ai icon indicating copy to clipboard operation
jupyter-ai copied to clipboard

:bug: Unable to call "huggingface_hub" > deprecation.py:131: FutureWarning: 'InferenceApi

Open adriens opened this issue 1 year ago • 1 comments

:grey_question: About

I'm trying to add a demo on top of huggingface mode with the following code:

%%ai huggingface_hub:TinyLlama/TinyLlama-1.1B-Chat-v1.0
Write a poem about rust language

... but I'm getting the following warning message:

/opt/conda/lib/python3.10/site-packages/huggingface_hub/utils/_deprecation.py:131:
FutureWarning: 'InferenceApi' (from 'huggingface_hub.inference_api') is deprecated
and will be removed from version '1.0'. `InferenceApi` client is deprecated in favor of
the more feature-complete `InferenceClient`.
Check out this guide to learn how to convert your script to use it: 
https://huggingface.co/docs/huggingface_hub/guides/inference#legacy-inferenceapi-client.
  warnings.warn(warning_message, FutureWarning)

without any answer.

image

:dart: Expected vs. current behavior

:point_right: I would expect to get the answer from HF, but got an empty answer:

image

:information_source: Runtime

  • Kaggle
  • Worls well with openai/chatgpt

adriens avatar Jan 13 '24 04:01 adriens

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Jan 13 '24 04:01 welcome[bot]

@adriens can you try with the latest v2.16.0? https://github.com/jupyterlab/jupyter-ai/pull/784 migrated to the new API.

krassowski avatar May 22 '24 10:05 krassowski

@adriens @krassowski I tried it with the latest release. The problem seems to be with the hosted model on huggingface. If I use another model (mistral) it works fine but not with TinyLlama as shown here: image This seems to be a response error on the HF side. So to cross check I went to the model page and ran the model in the UI and we get this error confirming that this model cannot be used as shown below image I usually find it's best with HF to try the model out on the model page as some of the models have also become unresponsive. Hope this helps.

srdas avatar May 22 '24 16:05 srdas

I'm giving it a try :zap:

adriens avatar May 22 '24 21:05 adriens

image

:crossed_fingers:

adriens avatar May 22 '24 21:05 adriens

image

adriens avatar May 22 '24 21:05 adriens

So with the following code :

%%ai huggingface_hub:mistralai/Mistral-7B-v0.1
Write a poem about rust language

After many seconds, I get the following error:

image

image

adriens avatar May 22 '24 21:05 adriens

:partying_face: image

adriens avatar May 22 '24 21:05 adriens

I'll publish the update and tweet about it :zap: Great job guys :pray: :kissing:

adriens avatar May 22 '24 21:05 adriens

But now I'm facing a regression on chatgpt

image

adriens avatar May 22 '24 21:05 adriens

  • https://github.com/jupyterlab/jupyter-ai/issues/803

adriens avatar May 22 '24 21:05 adriens

Tweet

image

adriens avatar May 25 '24 02:05 adriens