Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor
huggingface
config support (#742)
* do not override config deprefix_prompt Signed-off-by: Jeffrey Martin <[email protected]> * improve code reuse * consolidate `__init__` where possible * shift generator or model object creation to `_load_client()` Signed-off-by: Jeffrey Martin <[email protected]> * crude implmentation of limitation on parallel generator call Signed-off-by: Jeffrey Martin <[email protected]> * add torch `mps` support & enabled passed pipeline params * detect cuda vs mps vs cpu in a common way * guard import of OptimimPipeline Signed-off-by: Jeffrey Martin <[email protected]> * enable hf model or pipeline config in `hf_args` * support all generic `pipeline` args at all times * adds `do_sample` when `model` is a parameter to the `Callable` * adds `low_cpu_mem_usage` and all `pipeline` for `Callables` without `model` * consolidates optimal device selection & set when not provided by config Signed-off-by: Jeffrey Martin <[email protected]> * amend yaml config example * support merged dictionary in `Configurable` Signed-off-by: Jeffrey Martin <[email protected]> * free tokenizer in _clear_client Signed-off-by: Jeffrey Martin <[email protected]> * explicit device support * raise error when passed negative device integer * rename parameter tracking var * remove unused import * add tests for `_select_hf_device()` Signed-off-by: Jeffrey Martin <[email protected]> --------- Signed-off-by: Jeffrey Martin <[email protected]>
- Loading branch information