Private chat with local GPT with document, images, video, etc. 100% private, Apache 2.0. Supports oLLaMa, Mixtral, llama.cpp, and more. Demo: https://gpt.h2o.ai/ https://gpt-docs.h2o.ai/
When I typed: python generate.py --base_model='llama' --prompt_type=wizard2 --score_model=None --langchain_mode='UserData' --user_path=C:\Users\Hari Prezadu\h2ogpt
It is showing error:(h2ogpt) C:\Users\Hari Prezadu\h2ogpt>python generate.py --base_model='llama' --prompt_type=wizard2 --score_model=None --langchain_mode='UserData' --user_path=C:\Users\Hari Prezadu\h2ogpt
Using Model llama
Prep: persist_directory=db_dir_UserData exists, user_path=C:\Users\Hari passed, adding any changed or new documents
load INSTRUCTOR_Transformer
max_seq_length 512
0%| | 0/1 [00:00<?, ?it/s]Failed to ingest C:\Users\Hari due to Traceback (most recent call last):
File "C:\Users\Hari Prezadu\h2ogpt\src\gpt_langchain.py", line 1485, in path_to_doc1
res = file_to_doc(file, base_path=None, verbose=verbose, fail_any_exception=fail_any_exception,
File "C:\Users\Hari Prezadu\h2ogpt\src\gpt_langchain.py", line 1445, in file_to_doc
raise RuntimeError("No file handler for %s" % os.path.basename(file))
RuntimeError: No file handler for Hari
100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 476.57it/s]
0it [00:00, ?it/s]
Loaded 1 new files as sources to add to UserData
Loaded 1 sources for potentially adding to UserData
Existing db, potentially adding 1 sources from user_path=C:\Users\Hari
Found 1 new sources (1 have no hash in original source, so have to reprocess for migration to sources with hash)
Removing 1 duplicate files from db because ingesting those as new documents
Existing db, added 1 new sources from user_path=C:\Users\Hari
Starting get_model: llama
Could not determine --max_seq_len, setting to 2048. Pass if not correct
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Users\Hari Prezadu\h2ogpt\generate.py:16 in │
│ │
│ 13 │
│ 14 │
│ 15 if name == "main": │
│ ❱ 16 │ entrypoint_main() │
│ 17 │
│ │
│ C:\Users\Hari Prezadu\h2ogpt\generate.py:12 in entrypoint_main │
│ │
│ 9 │
│ 10 │
│ 11 def entrypoint_main(): │
│ ❱ 12 │ H2O_Fire(main) │
│ 13 │
│ 14 │
│ 15 if name == "main": │
│ │
│ C:\Users\Hari Prezadu\h2ogpt\src\utils.py:57 in H2O_Fire │
│ │
│ 54 │ │ │
│ 55 │ │ args.append(f"--{new_key}={value}") │
│ 56 │ │
│ ❱ 57 │ fire.Fire(component=component, command=args) │
│ 58 │
│ 59 │
│ 60 def set_seed(seed: int): │
│ │
│ C:\miniconda3\envs\h2ogpt\lib\site-packages\fire\core.py:141 in Fire │
│ │
│ 138 │ context.update(caller_globals) │
│ 139 │ context.update(caller_locals) │
│ 140 │
│ ❱ 141 component_trace = _Fire(component, args, parsed_flag_args, context, name) │
│ 142 │
│ 143 if component_trace.HasError(): │
│ 144 │ _DisplayError(component_trace) │
│ │
│ C:\miniconda3\envs\h2ogpt\lib\site-packages\fire\core.py:475 in _Fire │
│ │
│ 472 │ is_class = inspect.isclass(component) │
│ 473 │ │
│ 474 │ try: │
│ ❱ 475 │ │ component, remaining_args = _CallAndUpdateTrace( │
│ 476 │ │ │ component, │
│ 477 │ │ │ remaining_args, │
│ 478 │ │ │ component_trace, │
│ │
│ C:\miniconda3\envs\h2ogpt\lib\site-packages\fire\core.py:691 in _CallAndUpdateTrace │
│ │
│ 688 │ loop = asyncio.get_event_loop() │
│ 689 │ component = loop.run_until_complete(fn(*varargs, *kwargs)) │
│ 690 else: │
│ ❱ 691 │ component = fn(varargs, kwargs) │
│ 692 │
│ 693 if treatment == 'class': │
│ 694 │ action = trace.INSTANTIATED_CLASS │
│ │
│ C:\Users\Hari Prezadu\h2ogpt\src\gen.py:803 in main │
│ │
│ 800 │ │ │ all_kwargs.update(dict(base_model=base_model1, tokenizer_base_model=tokenize │
│ 801 │ │ │ │ │ │ │ │ lora_weights=lora_weights1, inference_server=inferenc │
│ 802 │ │ │ if base_model1 and not login_mode_if_model0: │
│ ❱ 803 │ │ │ │ model0, tokenizer0, device = get_model(reward_type=False, │
│ 804 │ │ │ │ │ │ │ │ │ │ │ │ │ get_kwargs(get_model, exclude_n │
│ 805 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ all_kwargs)) │
│ 806 │ │ │ else: │
│ │
│ C:\Users\Hari Prezadu\h2ogpt\src\gen.py:1205 in get_model │
│ │
│ 1202 │ assert not inference_server, "Malformed inference_server=%s" % inference_server │
│ 1203 │ if base_model in non_hf_types: │
│ 1204 │ │ from gpt4all_llm import get_model_tokenizer_gpt4all │
│ ❱ 1205 │ │ model, tokenizer, device = get_model_tokenizer_gpt4all(base_model) │
│ 1206 │ │ return model, tokenizer, device │
│ 1207 │ if load_exllama: │
│ 1208 │ │ return model_loader, tokenizer, 'cuda' │
│ │
│ C:\Users\Hari Prezadu\h2ogpt\src\gpt4all_llm.py:42 in get_model_tokenizer_gpt4all │
│ │
│ 39 │ │ func_names = list(inspect.signature(Llama.init).parameters) │
│ 40 │ │ model_kwargs = {k: v for k, v in model_kwargs.items() if k in func_names} │
│ 41 │ │ model_kwargs['n_ctx'] = int(model_kwargs['n_ctx']) │
│ ❱ 42 │ │ model = Llama(model_path=model_path, model_kwargs) │
│ 43 │ elif base_model in "gpt4all_llama": │
│ 44 │ │ if 'model_name_gpt4all_llama' not in model_kwargs and 'model_path_gpt4all_llama' │
│ 45 │ │ │ raise ValueError("No model_name_gpt4all_llama or model_path_gpt4all_llama in │
│ │
│ C:\miniconda3\envs\h2ogpt\lib\site-packages\llama_cpp\llama.py:281 in init │
│ │
│ 278 │ │ ### DEPRECATED ### │
│ 279 │ │ │
│ 280 │ │ if not os.path.exists(model_path): │
│ ❱ 281 │ │ │ raise ValueError(f"Model path does not exist: {model_path}") │
│ 282 │ │ │
│ 283 │ │ self.model = llama_cpp.llama_load_model_from_file( │
│ 284 │ │ │ self.model_path.encode("utf-8"), self.params │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: Model path does not exist: llama-2-7b-chat.ggmlv3.q8_0.bin
Exception ignored in: <function Llama.del at 0x0000023CD0BF80D0>
Traceback (most recent call last):
File "C:\miniconda3\envs\h2ogpt\lib\site-packages\llama_cpp\llama.py", line 1442, in del
if self.model is not None:
AttributeError: 'Llama' object has no attribute 'model'
And also I have doubt about where to paste the "WizardLM-7B-uncensored.ggmlv3.q8_0.bin" model.
-Should I paste the model in Models folder or h2ogpt folder
And is this correct:
--user_path=C:\Users\Example\h2ogpt
[Sorry for long issue text] I was trying to install h2o GPT as per info in readme and the following error came:
message.txt
When I typed: python generate.py --base_model='llama' --prompt_type=wizard2 --score_model=None --langchain_mode='UserData' --user_path=C:\Users\Hari Prezadu\h2ogpt
It is showing error:(h2ogpt) C:\Users\Hari Prezadu\h2ogpt>python generate.py --base_model='llama' --prompt_type=wizard2 --score_model=None --langchain_mode='UserData' --user_path=C:\Users\Hari Prezadu\h2ogpt Using Model llama Prep: persist_directory=db_dir_UserData exists, user_path=C:\Users\Hari passed, adding any changed or new documents load INSTRUCTOR_Transformer max_seq_length 512 0%| | 0/1 [00:00<?, ?it/s]Failed to ingest C:\Users\Hari due to Traceback (most recent call last): File "C:\Users\Hari Prezadu\h2ogpt\src\gpt_langchain.py", line 1485, in path_to_doc1 res = file_to_doc(file, base_path=None, verbose=verbose, fail_any_exception=fail_any_exception, File "C:\Users\Hari Prezadu\h2ogpt\src\gpt_langchain.py", line 1445, in file_to_doc raise RuntimeError("No file handler for %s" % os.path.basename(file)) RuntimeError: No file handler for Hari
100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 476.57it/s] 0it [00:00, ?it/s] Loaded 1 new files as sources to add to UserData Loaded 1 sources for potentially adding to UserData Existing db, potentially adding 1 sources from user_path=C:\Users\Hari Found 1 new sources (1 have no hash in original source, so have to reprocess for migration to sources with hash) Removing 1 duplicate files from db because ingesting those as new documents Existing db, added 1 new sources from user_path=C:\Users\Hari Starting get_model: llama Could not determine --max_seq_len, setting to 2048. Pass if not correct ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ C:\Users\Hari Prezadu\h2ogpt\generate.py:16 in │
│ │
│ 13 │
│ 14 │
│ 15 if name == "main": │
│ ❱ 16 │ entrypoint_main() │
│ 17 │
│ │
│ C:\Users\Hari Prezadu\h2ogpt\generate.py:12 in entrypoint_main │
│ │
│ 9 │
│ 10 │
│ 11 def entrypoint_main(): │
│ ❱ 12 │ H2O_Fire(main) │
│ 13 │
│ 14 │
│ 15 if name == "main": │
│ │
│ C:\Users\Hari Prezadu\h2ogpt\src\utils.py:57 in H2O_Fire │
│ │
│ 54 │ │ │
│ 55 │ │ args.append(f"--{new_key}={value}") │
│ 56 │ │
│ ❱ 57 │ fire.Fire(component=component, command=args) │
│ 58 │
│ 59 │
│ 60 def set_seed(seed: int): │
│ │
│ C:\miniconda3\envs\h2ogpt\lib\site-packages\fire\core.py:141 in Fire │
│ │
│ 138 │ context.update(caller_globals) │
│ 139 │ context.update(caller_locals) │
│ 140 │
│ ❱ 141 component_trace = _Fire(component, args, parsed_flag_args, context, name) │
│ 142 │
│ 143 if component_trace.HasError(): │
│ 144 │ _DisplayError(component_trace) │
│ │
│ C:\miniconda3\envs\h2ogpt\lib\site-packages\fire\core.py:475 in _Fire │
│ │
│ 472 │ is_class = inspect.isclass(component) │
│ 473 │ │
│ 474 │ try: │
│ ❱ 475 │ │ component, remaining_args = _CallAndUpdateTrace( │
│ 476 │ │ │ component, │
│ 477 │ │ │ remaining_args, │
│ 478 │ │ │ component_trace, │
│ │
│ C:\miniconda3\envs\h2ogpt\lib\site-packages\fire\core.py:691 in _CallAndUpdateTrace │
│ │
│ 688 │ loop = asyncio.get_event_loop() │
│ 689 │ component = loop.run_until_complete(fn(*varargs, *kwargs)) │
│ 690 else: │
│ ❱ 691 │ component = fn(varargs, kwargs) │
│ 692 │
│ 693 if treatment == 'class': │
│ 694 │ action = trace.INSTANTIATED_CLASS │
│ │
│ C:\Users\Hari Prezadu\h2ogpt\src\gen.py:803 in main │
│ │
│ 800 │ │ │ all_kwargs.update(dict(base_model=base_model1, tokenizer_base_model=tokenize │
│ 801 │ │ │ │ │ │ │ │ lora_weights=lora_weights1, inference_server=inferenc │
│ 802 │ │ │ if base_model1 and not login_mode_if_model0: │
│ ❱ 803 │ │ │ │ model0, tokenizer0, device = get_model(reward_type=False, │
│ 804 │ │ │ │ │ │ │ │ │ │ │ │ │ get_kwargs(get_model, exclude_n │
│ 805 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ all_kwargs)) │
│ 806 │ │ │ else: │
│ │
│ C:\Users\Hari Prezadu\h2ogpt\src\gen.py:1205 in get_model │
│ │
│ 1202 │ assert not inference_server, "Malformed inference_server=%s" % inference_server │
│ 1203 │ if base_model in non_hf_types: │
│ 1204 │ │ from gpt4all_llm import get_model_tokenizer_gpt4all │
│ ❱ 1205 │ │ model, tokenizer, device = get_model_tokenizer_gpt4all(base_model) │
│ 1206 │ │ return model, tokenizer, device │
│ 1207 │ if load_exllama: │
│ 1208 │ │ return model_loader, tokenizer, 'cuda' │
│ │
│ C:\Users\Hari Prezadu\h2ogpt\src\gpt4all_llm.py:42 in get_model_tokenizer_gpt4all │
│ │
│ 39 │ │ func_names = list(inspect.signature(Llama.init).parameters) │
│ 40 │ │ model_kwargs = {k: v for k, v in model_kwargs.items() if k in func_names} │
│ 41 │ │ model_kwargs['n_ctx'] = int(model_kwargs['n_ctx']) │
│ ❱ 42 │ │ model = Llama(model_path=model_path, model_kwargs) │
│ 43 │ elif base_model in "gpt4all_llama": │
│ 44 │ │ if 'model_name_gpt4all_llama' not in model_kwargs and 'model_path_gpt4all_llama' │
│ 45 │ │ │ raise ValueError("No model_name_gpt4all_llama or model_path_gpt4all_llama in │
│ │
│ C:\miniconda3\envs\h2ogpt\lib\site-packages\llama_cpp\llama.py:281 in init │
│ │
│ 278 │ │ ### DEPRECATED ### │
│ 279 │ │ │
│ 280 │ │ if not os.path.exists(model_path): │
│ ❱ 281 │ │ │ raise ValueError(f"Model path does not exist: {model_path}") │
│ 282 │ │ │
│ 283 │ │ self.model = llama_cpp.llama_load_model_from_file( │
│ 284 │ │ │ self.model_path.encode("utf-8"), self.params │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: Model path does not exist: llama-2-7b-chat.ggmlv3.q8_0.bin
Exception ignored in: <function Llama.del at 0x0000023CD0BF80D0>
Traceback (most recent call last):
File "C:\miniconda3\envs\h2ogpt\lib\site-packages\llama_cpp\llama.py", line 1442, in del
if self.model is not None:
AttributeError: 'Llama' object has no attribute 'model'
And also I have doubt about where to paste the "WizardLM-7B-uncensored.ggmlv3.q8_0.bin" model. -Should I paste the model in Models folder or h2ogpt folder
And is this correct: --user_path=C:\Users\Example\h2ogpt