-
Notifications
You must be signed in to change notification settings - Fork 570
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
Add list_deployed_models to inference client #1622
Changes from all commits
8e074ba
f097336
f1b030f
62f83a1
d9d3eae
61a6b35
d6432c0
476f086
8a400f9
e477547
887555f
26ab042
8553ca5
0511699
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,3 +129,41 @@ def _as_int(value: Optional[str]) -> Optional[int]: | |
HF_HUB_LOCAL_DIR_AUTO_SYMLINK_THRESHOLD: int = ( | ||
_as_int(os.environ.get("HF_HUB_LOCAL_DIR_AUTO_SYMLINK_THRESHOLD")) or 5 * 1024 * 1024 | ||
) | ||
|
||
# List frameworks that are handled by the InferenceAPI service. Useful to scan endpoints and check which models are | ||
# deployed and running. Since 95% of the models are using the top 4 frameworks listed below, we scan only those by | ||
# default. We still keep the full list of supported frameworks in case we want to scan all of them. | ||
MAIN_INFERENCE_API_FRAMEWORKS = [ | ||
"diffusers", | ||
"sentence-transformers", | ||
"text-generation-inference", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I consider it as a framework because that's how the InferenceAPI route call it: https://api-inference.huggingface.co/framework/text-generation-inference . I don't think it's worth changing the naming here (arguably, TGI is not a library like transformers but still a framework to power inference on the server isn't it?). |
||
"transformers", | ||
] | ||
|
||
ALL_INFERENCE_API_FRAMEWORKS = MAIN_INFERENCE_API_FRAMEWORKS + [ | ||
"adapter-transformers", | ||
"allennlp", | ||
"asteroid", | ||
"bertopic", | ||
"doctr", | ||
"espnet", | ||
"fairseq", | ||
"fastai", | ||
"fasttext", | ||
"flair", | ||
"generic", | ||
"k2", | ||
"keras", | ||
"mindspore", | ||
"nemo", | ||
"open_clip", | ||
"paddlenlp", | ||
"peft", | ||
"pyannote-audio", | ||
"sklearn", | ||
"spacy", | ||
"span-marker", | ||
"speechbrain", | ||
"stanza", | ||
"timm", | ||
] |
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.
Current distribution of libraries (a bit outdated but good proxy)
I think going with transformers, ST and diffusers support is good for now!
cc @LysandreJik and @julien-c for vis
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.
I think we have a confusion between what we consider a "framework" on the Hub and what is considered as "framework" under the hood for InferenceAPI. As I see it,
list_deployed_models
should be a helper to help discoverability of models already deployed so that the user don't have to wait for the model to load. I don't think we should choose theMAIN_INFERENCE_API_FRAMEWORKS
list based on the Hub distribution but rather on the InferenceAPI distribution.I know it is only a proxy but if I check every possible inference framework currently deployed, I get this:
Which is why I chose those 4 frameworks. Also AFAIK, TGI models deployed on InferenceAPI is in fact a curated list of models that we consider as worthy to run which makes it even more important to list by default IMO (since users cannot spin-up LLMs by themselves the same way as any small-enough diffusers/transformers model)
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.
Discussed offline.
The current solution is not ideal (might lead to confusion between Hub frameworks vs InferenceAPI frameworks) but hopefully it shouldn't be too bad as we (I) expect most users to not use the
frameworks
parameters and just take the default output. I added twoTip
sections in the docstring to remind thatlist_deployed_models
andget_model_status
are meant to be complementary (the first one for discoverability, the second one for users that know what they want).