diff --git a/setup.cfg b/setup.cfg index 0120d365d7..2017cb7b7b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,7 @@ zip_safe = False include_package_data = True packages = find: install_requires = - xoscar + xoscar>=0.1.2 xorbits gradio>=3.39.0 click diff --git a/xinference/model/llm/ggml/llamacpp.py b/xinference/model/llm/ggml/llamacpp.py index 049319da6f..e42ff1313b 100644 --- a/xinference/model/llm/ggml/llamacpp.py +++ b/xinference/model/llm/ggml/llamacpp.py @@ -184,7 +184,15 @@ def _convert_ggml_to_gguf(self, model_path: str) -> str: def load(self): try: + import llama_cpp from llama_cpp import Llama + + if llama_cpp.__version__ < "0.2.0": + raise ValueError( + "The llama_cpp version must be greater than 0.2.0. " + "Please upgrade your version via `pip install -U llama_cpp` or refer to " + "https://github.com/abetlen/llama-cpp-python#installation-with-openblas--cublas--clblast--metal." + ) except ImportError: error_message = "Failed to import module 'llama_cpp'" installation_guide = [