diff --git a/openllm-python/pyproject.toml b/openllm-python/pyproject.toml index 4a4bb9d3..3c9f97c7 100644 --- a/openllm-python/pyproject.toml +++ b/openllm-python/pyproject.toml @@ -109,6 +109,7 @@ fine-tune = [ "accelerate", "trl", "scipy", + "huggingface-hub", ] flan-t5 = ["transformers>=4.34.0"] full = [ diff --git a/openllm-python/src/openllm/_llm.py b/openllm-python/src/openllm/_llm.py index 5aedae22..739dae82 100644 --- a/openllm-python/src/openllm/_llm.py +++ b/openllm-python/src/openllm/_llm.py @@ -80,12 +80,7 @@ def _resolve_peft_config_type(adapter_map: dict[str, str]) -> AdapterMap: raise RuntimeError( "LoRA adapter requires 'peft' to be installed. Make sure to do 'pip install \"openllm[fine-tune]\"'" ) - try: - from huggingface_hub import hf_hub_download - except ImportError: - raise MissingDependencyError( - "Failed to import 'huggingface_hub'. Make sure to do 'pip install \"openllm[fine-tune]\"'" - ) from None + from huggingface_hub import hf_hub_download resolved: AdapterMap = {} for path_or_adapter_id, name in adapter_map.items(): diff --git a/tools/dependencies.py b/tools/dependencies.py index ce55507c..096cb6a6 100755 --- a/tools/dependencies.py +++ b/tools/dependencies.py @@ -159,7 +159,7 @@ _BASE_DEPENDENCIES = [ Dependencies(name='bitsandbytes', upper_constraint='0.42'), # 0.41 works with CUDA 11.8 ] -FINE_TUNE_DEPS = ['peft>=0.6.0', 'bitsandbytes', 'datasets', 'accelerate', 'trl', 'scipy'] +FINE_TUNE_DEPS = ['peft>=0.6.0', 'bitsandbytes', 'datasets', 'accelerate', 'trl', 'scipy', 'huggingface-hub'] FLAN_T5_DEPS = ['transformers>=4.34.0'] OPT_DEPS = ['transformers>=4.34.0'] GRPC_DEPS = ['openllm-client[grpc]']