-
Notifications
You must be signed in to change notification settings - Fork 341
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
Use HF safetensors by default #1046
Conversation
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.
Should this be expanded to set hf_args
values? In the huggingface
generator classes and in HFDetector
?
Based on the current testing results and the finding noted about Callable
signatures currently used I suspect this will need more refining to determine a valid approach since it seems unclear what models will have safe tensors.
if "use_safetensors" not in params: | ||
args["use_safetensors"] = True | ||
|
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.
A default not supplied by DEFAULT_PARAMS['hf_args']
should only be injected if the hf_constucutor
is expected to support or pass thru the option:
The following methods are currently passed as hf_constructor
:
transformers.pipeline
transformers.AutoConfig.from_pretrained
transformers.AutoModelForSeq2SeqLM.from_pretrained
transformers.LlavaNextForConditionalGeneration.from_pretrained
Unfortunately all the above methods mask use_safetensors
as part of an optional **kwarg
param.
This gathering pattern may not work for this option.
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.
Yeah, that's exactly where I ended up with this also. Inspection doesn't immediately reveal the parameter, and support it not universal. There are some lists of what supports this but I prefer something that responds to the code at hand. More research needed.
print(dir(_config.system)) | ||
|
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.
Errant debugging statement?
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.
extremely
see #990 (comment) - pausing for now |
Support
use_safetensors
in hugging face models & enable by defaultVerification
Little tricky since HF doesn't always go for pickles even if they're present and
use_safetensors
is disabled: