-
Notifications
You must be signed in to change notification settings - Fork 259
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
[Inference API] Add image-text-to-text task and fix generate
script
#1440
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
The PR documentation is not deployed correctly and returns 404 🤔 did I miss something? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @hanouticelina! Seems like you uncovered some annoying discrepancies 🙈
The PR documentation is not deployed correctly and returns 404 🤔 did I miss something?
Maybe it needed some time to update. Link is working for me now: https://moon-ci-docs.huggingface.co/docs/api-inference/pr_1440/en/index
import requests | ||
|
||
API_URL = "https://api-inference.huggingface.co/models/HuggingFaceM4/idefics2-8b-chatty" | ||
headers = {"Authorization": "Bearer hf_***"} | ||
|
||
from huggingface_hub import InferenceClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not expected (i.e. having import requests ...
before from huggingface_hub import InferenceClient
). I realized that https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct?inference_api=true has a problem. Model doesn't have a chat template and therefore is not tagged as "conversational"
which creates this weird side effect.
So I see 3 independent things to correct here:
- it would be nice to recommend
meta-llama/Llama-3.2-11B-Vision-Instruct
first on the image-text-to-image task page (to update here) - we should fix in moon-landing the
"conversational"
detection. At the moment, it's based only on the presence of a chat template. However for idefics chatty 8b it seems it's using "use_default_system_prompt": true instead. @Rocketknight1 is it safe to assume that a model with no chat template but this parameter set to True is in fact a conversational model? And if not, which parameter could we check? - For non-conversational
image-text-to-text
(does that even exist?), we should fix the snippet generator so that only therequests
-based snippet is displayed instead of this weird combination.
cc @osanseviero as well for viz'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to add, HuggingFaceM4/idefics2-8b-chatty
has thechat_template
defined in the processor_config.json. The tokenizer.chat_template
attribute is supposed to be saved in tokenizer_config.json
file. I guess the template was set using transformers.ProcessorMixin
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the 3rd point, pinging @mishig25 since it's related to huggingface.js/pull/938. do you think it's okay to map image-text-to-text to snippetBasic
instead and define the task input here ?
scripts/api-inference/templates/task/image-text-to-text.handlebars
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hanouticelina ! Now that huggingface/huggingface.js#956 has been merged, can you regenerate the docs which should finally highlight Llama 11B Vision model 😄
@Wauplin I regenerated the docs and Llama 11B Vision is finally highlighted! - This is only a subset of the supported models. Find the model that suits you best [here](...)
+ Explore all available models and find the one that suits you best [here](...) I think we're pretty much good to finally merge this PR :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such a nice addition! Thanks @hanouticelina for packing this up 🤗
This PR does two things:
image-text-to-text
task in the documentation.huggingface/tasks
and generate the documentations.