查询和总结您的文档,或者只是使用 h2oGPT(一个 Apache V2 开源项目)与本地私有 GPT LLM 聊天。
https://github.com/h2oai/h2ogpt
https://gpt.h2o.ai/
https://huggingface.co/h2oai
上传文件这里注意可以上传本地的常见的各种类型的文件。
支持的本机数据类型
生成回答,可以看到提问问题后,多个模型同时回答,用户可以选择一个自己感觉比较合理的回答。
文档管理
可以查看和管理自己上传的文档。
聊天记录管理:
自定义输出配置
1:下载 Visual Studio 2022
2:下载 MinGW 安装程序
3:下载并安装Miniconda
4:安装依赖
# Required for Doc Q/A: LangChain:
pip install -r reqs_optional/requirements_optional_langchain.txt
# Required for CPU: LLaMa/GPT4All:
pip install -r reqs_optional/requirements_optional_gpt4all.txt
# Optional: PyMuPDF/ArXiv:
pip install -r reqs_optional/requirements_optional_langchain.gpllike.txt
# Optional: Selenium/PlayWright:
pip install -r reqs_optional/requirements_optional_langchain.urls.txt
# Optional: for supporting unstructured package
python -m nltk.downloader all
5:可选配置
6:运行
For document Q/A with UI using LLaMa.cpp-based model on CPU or GPU:
python generate.py --base_model='llama' --prompt_type=wizard2 --score_model=None --langchain_mode='UserData' --user_path=user_path
7:使用和分享
Starting get_model: llama
ggml_init_cublas: found 2 CUDA devices:
Device 0: NVIDIA GeForce RTX 3090 Ti
Device 1: NVIDIA GeForce RTX 2080
llama.cpp: loading model from WizardLM-7B-uncensored.ggmlv3.q8_0.bin
llama_model_load_internal: format = ggjt v3 (latest)
llama_model_load_internal: n_vocab = 32001
llama_model_load_internal: n_ctx = 1792
llama_model_load_internal: n_embd = 4096
llama_model_load_internal: n_mult = 256
llama_model_load_internal: n_head = 32
llama_model_load_internal: n_layer = 32
llama_model_load_internal: n_rot = 128
llama_model_load_internal: ftype = 7 (mostly Q8_0)
llama_model_load_internal: n_ff = 11008
llama_model_load_internal: model size = 7B
llama_model_load_internal: ggml ctx size = 0.08 MB
llama_model_load_internal: using CUDA for GPU acceleration
ggml_cuda_set_main_device: using device 0 (NVIDIA GeForce RTX 3090 Ti) as main device
llama_model_load_internal: mem required = 4518.85 MB (+ 1026.00 MB per state)
llama_model_load_internal: allocating batch_size x (512 kB + n_ctx x 128 B) = 368 MB VRAM for the scratch buffer
llama_model_load_internal: offloading 20 repeating layers to GPU
llama_model_load_internal: offloaded 20/35 layers to GPU
llama_model_load_internal: total VRAM used: 4470 MB
llama_new_context_with_model: kv self size = 896.00 MB
AVX = 1 | AVX2 = 1 | AVX512 = 0 | AVX512_VBMI = 0 | AVX512_VNNI = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | VSX = 0 |
Model {'base_model': 'llama', 'tokenizer_base_model': '', 'lora_weights': '', 'inference_server': '', 'prompt_type': 'wizard2', 'prompt_dict': {'promptA': 'Below is an instruction that describes a task. Write a response that appropriately completes the request.', 'promptB': 'Below is an instruction that describes a task. Write a response that appropriately completes the request.', 'PreInstruct': '
### Instruction:
', 'PreInput': None, 'PreResponse': '
### Response:
', 'terminate_response': ['
### Response:
'], 'chat_sep': '
', 'chat_turn_sep': '
', 'humanstr': '
### Instruction:
', 'botstr': '
### Response:
', 'generates_leading_space': False}}
Running on local URL: http://0.0.0.0:7860
To create a public link, set `share=True` in `launch()`.
转到http://127.0.0.1:7860(忽略上面的消息)。添加--share=True以获得可共享的安全链接。
要仅与 LLM 聊天,请在“集合”中单击Resources并单击LLM,或者在不使用--langchain_mode=UserData.
在nvidia-smi或其他一些 GPU 监视器程序中,您应该看到python.exe在(计算)模式下使用 GPUC并使用 GPU 资源。
3090Ti 的 i9 上,每秒大约获得 5 个令牌。
如果您有多个 GPU,最好通过执行以下操作来指定使用快速 GPU(例如,如果设备 0 是最快且内存最大的 GPU)。
感兴趣的小伙伴们快去动手试试吧!
页面更新:2024-05-20
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号