marella / chatdocs

Chat with your documents offline using AI.
MIT License
684 stars 99 forks source link

RuntimeError: Failed to create LLM 'llama' #48

Open WykYuyi opened 1 year ago

WykYuyi commented 1 year ago

I have the same issue :

(chatdocs-main) PS G:\Chat\chatdocs-main> chatdocs download load INSTRUCTOR_Transformer max_seq_length 512 Fetching 0 files: 0it [00:00, ?it/s] Fetching 1 files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<?, ?it/s] error loading model: failed to open C:\Users\寰′付濂昞.cache\huggingface\hub\models--TheBloke--Wizard-Vicuna-7B-Uncensored-GGML\blobs\c31a4edd96527dcd808bcf9b99e3894065ac950747dac84ecd 415a2387454e7c: No such file or directory llama_init_from_file: failed to load model ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ E:\chatdocs-main\lib\site-packages\chatdocs\main.py:26 in download │ │ │ │ 23 │ from .download import download │ │ 24 │ │ │ 25 │ config = get_config(config) │ │ ❱ 26 │ download(config=config) │ │ 27 │ │ 28 │ │ 29 @app.command() │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ config = { │ │ │ │ │ 'embeddings': {'model': 'hkunlp/instructor-large'}, │ │ │ │ │ 'llm': 'ctransformers', │ │ │ │ │ 'ctransformers': { │ │ │ │ │ │ 'model': 'TheBloke/Wizard-Vicuna-7B-Uncensored-GGML', │ │ │ │ │ │ 'model_file': 'Wizard-Vicuna-7B-Uncensored.ggmlv3.q4_0.bin', │ │ │ │ │ │ 'model_type': 'llama', │ │ │ │ │ │ 'config': {'context_length': 1024, 'local_files_only': False} │ │ │ │ │ }, │ │ │ │ │ 'huggingface': { │ │ │ │ │ │ 'model': 'TheBloke/Wizard-Vicuna-7B-Uncensored-HF', │ │ │ │ │ │ 'pipeline_kwargs': {'max_new_tokens': 256} │ │ │ │ │ }, │ │ │ │ │ 'gptq': { │ │ │ │ │ │ 'model': 'TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ', │ │ │ │ │ │ 'model_file': │ │ │ │ 'Wizard-Vicuna-7B-Uncensored-GPTQ-4bit-128g.no-act-order.safetensors', │ │ │ │ │ │ 'pipeline_kwargs': {'max_new_tokens': 256} │ │ │ │ │ }, │ │ │ │ │ 'download': False, │ │ │ │ │ 'host': 'localhost', │ │ │ │ │ 'port': 5000, │ │ │ │ │ 'auth': False, │ │ │ │ │ 'chroma': { │ │ │ │ │ │ 'persist_directory': 'db', │ │ │ │ │ │ 'chroma_db_impl': 'duckdb+parquet', │ │ │ │ │ │ 'anonymized_telemetry': False │ │ │ │ │ }, │ │ │ │ │ ... +1 │ │ │ │ } │ │ │ │ download = <function download at 0x000001F46E199790> │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ E:\chatdocs-main\lib\site-packages\chatdocs\download.py:10 in download │ │ │ │ 7 def download(config: Dict[str, Any]) -> None: │ │ 8 │ config = {config, "download": True} │ │ 9 │ get_embeddings(config) │ │ ❱ 10 │ get_llm(config) │ │ 11 │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ config = { │ │ │ │ │ 'embeddings': {'model': 'hkunlp/instructor-large'}, │ │ │ │ │ 'llm': 'ctransformers', │ │ │ │ │ 'ctransformers': { │ │ │ │ │ │ 'model': 'TheBloke/Wizard-Vicuna-7B-Uncensored-GGML', │ │ │ │ │ │ 'model_file': 'Wizard-Vicuna-7B-Uncensored.ggmlv3.q4_0.bin', │ │ │ │ │ │ 'model_type': 'llama', │ │ │ │ │ │ 'config': {'context_length': 1024, 'local_files_only': False} │ │ │ │ │ }, │ │ │ │ │ 'huggingface': { │ │ │ │ │ │ 'model': 'TheBloke/Wizard-Vicuna-7B-Uncensored-HF', │ │ │ │ │ │ 'pipeline_kwargs': {'max_new_tokens': 256} │ │ │ │ │ }, │ │ │ │ │ 'gptq': { │ │ │ │ │ │ 'model': 'TheBloke/Wizard-Vicuna-7B-Uncensored-GPTQ', │ │ │ │ │ │ 'model_file': │ │ │ │ 'Wizard-Vicuna-7B-Uncensored-GPTQ-4bit-128g.no-act-order.safetensors', │ │ │ │ │ │ 'pipeline_kwargs': {'max_new_tokens': 256} │ │ │ │ │ }, │ │ │ │ │ 'download': True, │ │ │ │ │ 'host': 'localhost', │ │ │ │ │ 'port': 5000, │ │ │ │ │ 'auth': False, │ │ │ │ │ 'chroma': { │ │ │ │ │ │ 'persist_directory': 'db', │ │ │ │ │ │ 'chroma_db_impl': 'duckdb+parquet', │ │ │ │ │ │ 'anonymized_telemetry': False │ │ │ │ │ }, │ │ │ │ │ ... +1 │ │ │ │ } │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ E:\chatdocs-main\lib\site-packages\chatdocs\llms.py:73 in get_llm │ │ │ │ 70 │ if config["llm"] == "ctransformers": │ │ 71 │ │ config = {config["ctransformers"]} │ │ 72 │ │ config = merge(config, {"config": {"local_files_only": local_files_only}}) │ │ ❱ 73 │ │ llm = CTransformers(callbacks=callbacks, config) │ │ 74 │ elif config["llm"] == "gptq": │ │ 75 │ │ llm = get_gptq_llm(config) │ │ 76 │ else: │ │ │ │ ╭─────────────────────────────────────── locals ───────────────────────────────────────╮ │ │ │ callback = None │ │ │ │ CallbackHandler = <class 'chatdocs.llms.get_llm..CallbackHandler'> │ │ │ │ callbacks = None │ │ │ │ config = { │ │ │ │ │ 'model': 'TheBloke/Wizard-Vicuna-7B-Uncensored-GGML', │ │ │ │ │ 'model_file': 'Wizard-Vicuna-7B-Uncensored.ggmlv3.q4_0.bin', │ │ │ │ │ 'model_type': 'llama', │ │ │ │ │ 'config': { │ │ │ │ │ │ 'context_length': 1024, │ │ │ │ │ │ 'local_files_only': False │ │ │ │ │ } │ │ │ │ } │ │ │ │ local_files_only = False │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ E:\chatdocs-main\lib\site-packages\langchain\load\serializable.py:74 in init │ │ │ │ 71 │ _lc_kwargs = PrivateAttr(default_factory=dict) │ │ 72 │ │ │ 73 │ def init(self, kwargs: Any) -> None: │ │ ❱ 74 │ │ super().init(**kwargs) │ │ 75 │ │ self._lc_kwargs = kwargs │ │ 76 │ │ │ 77 │ def to_json(self) -> Union[SerializedConstructor, SerializedNotImplemented]: │ │ │ │ ╭─────────────────────────────────── locals ────────────────────────────────────╮ │ │ │ class = <class 'langchain.load.serializable.Serializable'> │ │ │ │ kwargs = { │ │ │ │ │ 'callbacks': None, │ │ │ │ │ 'model': 'TheBloke/Wizard-Vicuna-7B-Uncensored-GGML', │ │ │ │ │ 'model_file': 'Wizard-Vicuna-7B-Uncensored.ggmlv3.q4_0.bin', │ │ │ │ │ 'model_type': 'llama', │ │ │ │ │ 'config': { │ │ │ │ │ │ 'context_length': 1024, │ │ │ │ │ │ 'local_files_only': False │ │ │ │ │ } │ │ │ │ } │ │ │ │ self = CTransformers() │ │ │ ╰───────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ G:\Chat\chatdocs-main\pydantic\main.py:339 in pydantic.main.BaseModel.init │ │ │ │ [Errno 2] No such file or directory: 'G:\Chat\chatdocs-main\pydantic\main.py' │ │ │ │ G:\Chat\chatdocs-main\pydantic\main.py:1102 in pydantic.main.validate_model │ │ │ │ [Errno 2] No such file or directory: 'G:\Chat\chatdocs-main\pydantic\main.py' │ │ │ │ E:\chatdocs-main\lib\site-packages\langchain\llms\ctransformers.py:73 in validate_environment │ │ │ │ 70 │ │ │ ) │ │ 71 │ │ │ │ 72 │ │ config = values["config"] or {} │ │ ❱ 73 │ │ values["client"] = AutoModelForCausalLM.from_pretrained( │ │ 74 │ │ │ values["model"], │ │ 75 │ │ │ model_type=values["model_type"], │ │ 76 │ │ │ model_file=values["model_file"], │ │ │ │ ╭──────────────────────────────────────── locals ─────────────────────────────────────────╮ │ │ │ AutoModelForCausalLM = <class 'ctransformers.hub.AutoModelForCausalLM'> │ │ │ │ cls = <class 'langchain.llms.ctransformers.CTransformers'> │ │ │ │ config = {'context_length': 1024, 'local_files_only': False} │ │ │ │ values = { │ │ │ │ │ 'cache': None, │ │ │ │ │ 'verbose': False, │ │ │ │ │ 'callbacks': None, │ │ │ │ │ 'callback_manager': None, │ │ │ │ │ 'tags': None, │ │ │ │ │ 'metadata': None, │ │ │ │ │ 'client': None, │ │ │ │ │ 'model': 'TheBloke/Wizard-Vicuna-7B-Uncensored-GGML', │ │ │ │ │ 'model_type': 'llama', │ │ │ │ │ 'model_file': 'Wizard-Vicuna-7B-Uncensored.ggmlv3.q4_0.bin', │ │ │ │ │ ... +2 │ │ │ │ } │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ E:\chatdocs-main\lib\site-packages\ctransformers\hub.py:157 in from_pretrained │ │ │ │ 154 │ │ │ │ local_files_only=local_files_only, │ │ 155 │ │ │ ) │ │ 156 │ │ │ │ ❱ 157 │ │ return LLM( │ │ 158 │ │ │ model_path=model_path, │ │ 159 │ │ │ model_type=model_type, │ │ 160 │ │ │ config=config.config, │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ cls = <class 'ctransformers.hub.AutoModelForCausalLM'> │ │ │ │ config = AutoConfig( │ │ │ │ │ config=Config( │ │ │ │ │ │ top_k=40, │ │ │ │ │ │ top_p=0.95, │ │ │ │ │ │ temperature=0.8, │ │ │ │ │ │ repetition_penalty=1.1, │ │ │ │ │ │ last_n_tokens=64, │ │ │ │ │ │ seed=-1, │ │ │ │ │ │ batch_size=8, │ │ │ │ │ │ threads=-1, │ │ │ │ │ │ max_new_tokens=256, │ │ │ │ │ │ stop=None, │ │ │ │ │ │ stream=False, │ │ │ │ │ │ reset=True, │ │ │ │ │ │ context_length=1024, │ │ │ │ │ │ gpu_layers=0 │ │ │ │ │ ), │ │ │ │ │ model_type=None │ │ │ │ ) │ │ │ │ kwargs = {'context_length': 1024} │ │ │ │ lib = None │ │ │ │ local_files_only = False │ │ │ │ model_file = 'Wizard-Vicuna-7B-Uncensored.ggmlv3.q4_0.bin' │ │ │ │ model_path = 'C:\Users\御丶奕.cache\huggingface\hub\models--TheBloke--Wiz… │ │ │ │ model_path_or_repo_id = 'TheBloke/Wizard-Vicuna-7B-Uncensored-GGML' │ │ │ │ model_type = 'llama' │ │ │ │ path_type = 'repo' │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ E:\chatdocs-main\lib\site-packages\ctransformers\llm.py:214 in init │ │ │ │ 211 │ │ │ config.gpu_layers, │ │ 212 │ │ ) │ │ 213 │ │ if self._llm is None: │ │ ❱ 214 │ │ │ raise RuntimeError( │ │ 215 │ │ │ │ f"Failed to create LLM '{model_type}' from '{model_path}'." │ │ 216 │ │ │ ) │ │ 217 │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ config = Config( │ │ │ │ │ top_k=40, │ │ │ │ │ top_p=0.95, │ │ │ │ │ temperature=0.8, │ │ │ │ │ repetition_penalty=1.1, │ │ │ │ │ last_n_tokens=64, │ │ │ │ │ seed=-1, │ │ │ │ │ batch_size=8, │ │ │ │ │ threads=-1, │ │ │ │ │ max_new_tokens=256, │ │ │ │ │ stop=None, │ │ │ │ │ stream=False, │ │ │ │ │ reset=True, │ │ │ │ │ context_length=1024, │ │ │ │ │ gpu_layers=0 │ │ │ │ ) │ │ │ │ lib = None │ │ │ │ model_path = 'C:\Users\御丶奕.cache\huggingface\hub\models--TheBloke--Wizard-Vicuna-… │ │ │ │ model_type = 'llama' │ │ │ │ self = <ctransformers.llm.LLM object at 0x000001F4ED4A19A0> │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ RuntimeError: Failed to create LLM 'llama' from 'C:\Users\御丶奕.cache\huggingface\hub\models--TheBloke--Wizard-Vicuna-7B-Uncensored-GGML\blobs\c31a4edd96527dcd808bcf9b99e3894065ac950747dac84ecd415a2387454e7c'.