国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

本地搭建【文檔助手】大模型版(LangChain+llama+Streamlit)

這篇具有很好參考價值的文章主要介紹了本地搭建【文檔助手】大模型版(LangChain+llama+Streamlit)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

概述

本文的文檔助手就是:我們上傳一個文檔,然后在對話框中輸入問題,大模型會把問題的答案返回。

安裝步驟

  1. 先下載代碼到本地

LangChain調用llama模型的示例代碼:https://github.com/afaqueumer/DocQA(代碼不是本人寫的,尊重原創(chuàng))

git clone https://github.com/afaqueumer/DocQA.git
  1. 環(huán)境安裝
雙擊 setup_env.bat
  • 如果沒反應可能是缺少環(huán)境,打開控制臺手動執(zhí)行一下,缺python或者pip的自己根據報錯下載一下

如果llama-cpp-python安裝報錯
(1)需要下載Visual Studio
(2)打開Visual Studio,工具,獲取工具和功能
本地搭建【文檔助手】大模型版(LangChain+llama+Streamlit),大模型,langchain,llama,python,語言模型
(3)等待下載完,重新運行setup_env.bat

如果還有報錯【error C2061: 語法錯誤:】,那么可能是Visual Studio的版本太低了,我一開始用的是2019版本,后來換成了2022
本地搭建【文檔助手】大模型版(LangChain+llama+Streamlit),大模型,langchain,llama,python,語言模型
更新為2022之后重復上面操作

  1. 下載一個靠譜的模型
    https://huggingface.co/TheBloke/Llama-2-7B-GGUF
    本文用的是:TheBloke/Llama-2-7B-GGUF中的最精簡版
    本地搭建【文檔助手】大模型版(LangChain+llama+Streamlit),大模型,langchain,llama,python,語言模型
  2. 進入DocQA,修改app.py

原始

llm = LlamaCpp(model_path="./models/llama-7b.ggmlv3.q4_0.bin")
embeddings = LlamaCppEmbeddings(model_path="models/llama-7b.ggmlv3.q4_0.bin")

這里改成自己下載的模型地址,比如:llama-2-7b.Q2_K.gguf

llm = LlamaCpp(model_path="../llama.cpp/models/7B/llama-2-7b.Q2_K.gguf")
embeddings = LlamaCppEmbeddings(model_path="../llama.cpp/models/7B/llama-2-7b.Q2_K.gguf")
  1. 運行
雙擊run_app.bat

本地搭建【文檔助手】大模型版(LangChain+llama+Streamlit),大模型,langchain,llama,python,語言模型

  1. 測試

準備好一個txt文檔

As of October this year, there were nearly 2,500 geographical indication products in China
The reporter learned from the State Intellectual Property Office that in recent years, the quantity and quality of China's geographical indication products have risen rapidly. As of October this year, China has approved a total of 2,495 geographical indication products, and approved 7,013 geographical indications to be registered as collective trademarks and certification trademarks. In 2021, the direct output value of GI products exceeded 700 billion yuan.
In recent years, the State Intellectual Property Office has conscientiously implemented the decisions and arrangements of the CPC Central Committee and the State Council, actively and steadily promoted the unified acceptance channels, unified special signs, unified announcements, unified protection and supervision, unified foreign cooperation and other work, and further improved the system of protection, management and application of geographical indications.
In terms of institutional construction, the State Intellectual Property Office issued the "14th Five-Year Plan for the Protection and Use of Geographical Indications", formulated and issued a unified special indication for geographical indications, revised and issued the "Measures for the Protection of Foreign Geographical Indication Products", and launched the legislative work on geographical indications; In the year, a total of 1,416 cases of infringement of geographical indications were investigated and dealt with across the country, involving an amount of 9.28 million yuan and a fine of 13.023 million yuan

上傳到頁面中
本地搭建【文檔助手】大模型版(LangChain+llama+Streamlit),大模型,langchain,llama,python,語言模型
沒有GPU的痛苦,運行太慢了

注意:別用中文問,這個模型好像不支持中文,換一個支持中文的模型就行了
本地搭建【文檔助手】大模型版(LangChain+llama+Streamlit),大模型,langchain,llama,python,語言模型文章來源地址http://www.zghlxwxcb.cn/news/detail-764357.html

到了這里,關于本地搭建【文檔助手】大模型版(LangChain+llama+Streamlit)的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!

本文來自互聯(lián)網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉載,請注明出處: 如若內容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • 使用llama.cpp在本地搭建vicuna 13B語言模型

    使用llama.cpp在本地搭建vicuna 13B語言模型

    有人做了windows下的腳本放到github上了,直接運行就可以了。我在本機試了一下13B的模型能運行,但生成速度非常慢,回復一個問題基本上要花5分鐘以上的時間。我的機器配置 3900X?32G內存。 https://github.com/mps256/vicuna.ps1

    2024年02月11日
    瀏覽(24)
  • 開源大模型ChatGLM2-6B 2. 跟著LangChain參考文檔搭建LLM+知識庫問答系統(tǒng)

    開源大模型ChatGLM2-6B 2. 跟著LangChain參考文檔搭建LLM+知識庫問答系統(tǒng)

    租用了1臺GPU服務器,系統(tǒng) ubuntu20,Tesla V100-16GB (GPU服務器已經關機結束租賃了) SSH地址:* 端口:17520 SSH賬戶:root 密碼:Jaere7pa 內網: 3389 , 外網:17518 VNC地址:* 端口:17519 VNC用戶名:root 密碼:Jaere7pa 硬件需求,ChatGLM-6B和ChatGLM2-6B相當。 量化等級?? ?最低 GPU 顯存 F

    2024年02月03日
    瀏覽(32)
  • 使用langchain及l(fā)lama_index實現基于文檔(長文本)的相似查詢與詢問

    使用langchain及l(fā)lama_index實現基于文檔(長文本)的相似查詢與詢問

    前面的總結是半年前的知識與代碼,但是框架不變,所以不再修改。 但是半年更新了不少內容,包括一些類都更換了不少,有同學問到,所以就又重新寫一份,貼在下面。 考慮到這篇費了不少時間,關注一下不過分吧(?′?`?) 在調用ChatGPT接口時,我們常常受到4096個字符(

    2024年02月09日
    瀏覽(24)
  • LangChain+ChatGLM整合LLaMa模型(二)

    LangChain+ChatGLM整合LLaMa模型(二)

    LangChain+ChatGLM大模型應用落地實踐(一) LLaMa模型GitHub地址 添加LLaMa模型配置 在Langchain-ChatGLM/configs/model_config.py中l(wèi)lm_model_dict添加 啟用LLaMa模型 進入Web UI選擇LLaMa模型 LLAMA-7B(中文提問當作翻譯回答了…看來訓練的中文語料不太行,但是英文也算是答對了) 具體為什么LLaMa為什

    2024年02月14日
    瀏覽(20)
  • 【ollama】(2):在linux搭建環(huán)境,編譯ollama代碼,測試qwen大模型,本地運行速度飛快,本質上是對llama.cpp 項目封裝

    【ollama】(2):在linux搭建環(huán)境,編譯ollama代碼,測試qwen大模型,本地運行速度飛快,本質上是對llama.cpp 項目封裝

    https://github.com/ollama/ollama/tree/main/docs https://www.bilibili.com/video/BV1oS421w7aM/ 【ollama】(2):在linux搭建環(huán)境,編譯ollama代碼,測試qwen大模型,本地運行速度飛快,本質上是對llama.cpp 項目封裝 要是失敗執(zhí)行,子模塊更新: 需要編譯 llama.cpp 的代碼, 然后經過漫長的編譯,就而可以

    2024年04月08日
    瀏覽(28)
  • 基于Llama2和LangChain構建本地化定制化知識庫AI聊天機器人

    基于Llama2和LangChain構建本地化定制化知識庫AI聊天機器人

    參考: 本項目?https://github.com/PromtEngineer/localGPT 模型?https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML 云端知識庫項目:基于GPT-4和LangChain構建云端定制化PDF知識庫AI聊天機器人_Entropy-Go的博客-CSDN博客? ????????相比OpenAI的LLM ChatGPT模型必須網絡連接并通過API key云端調用模型,擔心

    2024年02月08日
    瀏覽(33)
  • 本地搭建屬于自己的ChatGPT:基于PyTorch+ChatGLM-6b+Streamlit+QDrant+DuckDuckGo

    本地搭建屬于自己的ChatGPT:基于PyTorch+ChatGLM-6b+Streamlit+QDrant+DuckDuckGo

    本地部署chatglm及緩解時效性問題的思路: 模型使用chatglm-6b 4bit,推理使用hugging face,前端應用使用streamlit或者gradio。 微調對顯存要求較高,還沒試驗??梢越Y合LoRA進行微調。 緩解時效性問題:通過本地數據庫或者搜索引擎獲取特有數據或者實時數據作為生成模型的上下文

    2024年02月02日
    瀏覽(19)
  • 基于LangChain+LLM的本地知識庫問答:從企業(yè)單文檔問答到批量文檔問答

    基于LangChain+LLM的本地知識庫問答:從企業(yè)單文檔問答到批量文檔問答

    過去半年,隨著ChatGPT的火爆,直接帶火了整個LLM這個方向,然LLM畢竟更多是基于過去的經驗數據預訓練而來,沒法獲取最新的知識,以及各企業(yè)私有的知識 為了獲取最新的知識,ChatGPT plus版集成了bing搜索的功能,有的模型則會調用一個定位于 “鏈接各種AI模型、工具”的

    2024年02月07日
    瀏覽(46)
  • 大模型部署手記(13)LLaMa2+Chinese-LLaMA-Plus-2-7B+Windows+LangChain+摘要問答

    大模型部署手記(13)LLaMa2+Chinese-LLaMA-Plus-2-7B+Windows+LangChain+摘要問答

    組織機構:Meta(Facebook) 代碼倉:GitHub - facebookresearch/llama: Inference code for LLaMA models 模型:chinese-alpaca-2-7b-hf、text2vec-large-chinese 下載:使用百度網盤和huggingface.co下載 硬件環(huán)境:暗影精靈7Plus Windows版本:Windows 11家庭中文版 Insider Preview 22H2 內存 32G GPU顯卡:Nvidia GTX 3080 Laptop

    2024年02月04日
    瀏覽(21)
  • Windows11下私有化部署大語言模型實戰(zhàn) langchain+llama2

    Windows11下私有化部署大語言模型實戰(zhàn) langchain+llama2

    CPU:銳龍5600X 顯卡:GTX3070 內存:32G 注:硬件配置僅為博主的配置,不是最低要求配置,也不是推薦配置。該配置下計算速度約為40tokens/s。實測核顯筆記本(i7-1165g7)也能跑,速度3tokens/s。 Windows系統(tǒng)版本:Win11專業(yè)版23H2 Python版本:3.11 Cuda版本:12.3.2 VS版本:VS2022 17.8.3 lan

    2024年02月03日
    瀏覽(1178)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包