GraphRAG+ollama+LM Studio+chainlit

news2024/9/19 6:56:13

这里我们进一步尝试将embedding模型也换为本地的,同时熟悉一下流程和学一些新的东西

1.环境还是用之前的,这里我们先下载LLM  

然后你会在下载nomic模型的时候崩溃,因为无法搜索,无法下载

解决办法如下
lm studio 0.2.24国内下载模型_lm studio 国内源-CSDN博客

按照上面的教程依旧无法下载模型,但是可以搜索了,没什么用

直接hugging face下载,然后导入llm  models文件夹

C:\Users\Administrator\.cache\lm-studio\models

注意有格式要求

C:\Users\Administrator\.cache\lm-studio\models\Publisher\Repository
将模型放在这个文件夹里才能被识别,然后加在模型

然后修改配置

settings.yaml

##我这里用到是我的另一个电脑运行LLM Studio  ,所以IP是127
encoding_model: cl100k_base
skip_workflows: []
llm:
  api_key: ollama
  type: openai_chat # or azure_openai_chat
  model: llama3
  model_supports_json: true # recommended if this is available for your model.
  # max_tokens: 4000
  # request_timeout: 180.0
  api_base: http://127.0.0.1:11434/v1
  # api_version: 2024-02-15-preview
  # organization: <organization_id>
  # deployment_name: <azure_model_deployment_name>
  # tokens_per_minute: 150_000 # set a leaky bucket throttle
  # requests_per_minute: 10_000 # set a leaky bucket throttle
  # max_retries: 10
  # max_retry_wait: 10.0
  # sleep_on_rate_limit_recommendation: true # whether to sleep when azure suggests wait-times
  # concurrent_requests: 25 # the number of parallel inflight requests that may be made

parallelization:
  stagger: 0.3
  # num_threads: 50 # the number of threads to use for parallel processing

async_mode: threaded # or asyncio

embeddings:
  ## parallelization: override the global parallelization settings for embeddings
  async_mode: threaded # or asyncio
  llm:
    api_key: lm-studio
    type: openai_embedding # or azure_openai_embedding
    model: Publisher/Repository/nomic-embed-text-v1.5.Q5_K_M.gguf
    api_base: http://192.168.1.127:1234/v1
    # api_version: 2024-02-15-preview
    # organization: <organization_id>
    # deployment_name: <azure_model_deployment_name>
    # tokens_per_minute: 150_000 # set a leaky bucket throttle
    # requests_per_minute: 10_000 # set a leaky bucket throttle
    # max_retries: 10
    # max_retry_wait: 10.0
    # sleep_on_rate_limit_recommendation: true # whether to sleep when azure suggests wait-times
    # concurrent_requests: 25 # the number of parallel inflight requests that may be made
    # batch_size: 16 # the number of documents to send in a single request
    # batch_max_tokens: 8191 # the maximum number of tokens to send in a single request
    # target: required # or optional
  


chunks:
  size: 300
  overlap: 100
  group_by_columns: [id] # by default, we don't allow chunks to cross documents
    
input:
  type: file # or blob
  file_type: text # or csv
  base_dir: "input"
  file_encoding: utf-8
  file_pattern: ".*\\.txt$"

cache:
  type: file # or blob
  base_dir: "cache"
  # connection_string: <azure_blob_storage_connection_string>
  # container_name: <azure_blob_storage_container_name>

storage:
  type: file # or blob
  base_dir: "output/${timestamp}/artifacts"
  # connection_string: <azure_blob_storage_connection_string>
  # container_name: <azure_blob_storage_container_name>

reporting:
  type: file # or console, blob
  base_dir: "output/${timestamp}/reports"
  # connection_string: <azure_blob_storage_connection_string>
  # container_name: <azure_blob_storage_container_name>

entity_extraction:
  ## llm: override the global llm settings for this task
  ## parallelization: override the global parallelization settings for this task
  ## async_mode: override the global async_mode settings for this task
  prompt: "prompts/entity_extraction.txt"
  entity_types: [organization,person,geo,event]
  max_gleanings: 0

summarize_descriptions:
  ## llm: override the global llm settings for this task
  ## parallelization: override the global parallelization settings for this task
  ## async_mode: override the global async_mode settings for this task
  prompt: "prompts/summarize_descriptions.txt"
  max_length: 500

claim_extraction:
  ## llm: override the global llm settings for this task
  ## parallelization: override the global parallelization settings for this task
  ## async_mode: override the global async_mode settings for this task
  # enabled: true
  prompt: "prompts/claim_extraction.txt"
  description: "Any claims or facts that could be relevant to information discovery."
  max_gleanings: 0

community_report:
  ## llm: override the global llm settings for this task
  ## parallelization: override the global parallelization settings for this task
  ## async_mode: override the global async_mode settings for this task
  prompt: "prompts/community_report.txt"
  max_length: 2000
  max_input_length: 8000

cluster_graph:
  max_cluster_size: 10

embed_graph:
  enabled: false # if true, will generate node2vec embeddings for nodes
  # num_walks: 10
  # walk_length: 40
  # window_size: 2
  # iterations: 3
  # random_seed: 597832

umap:
  enabled: false # if true, will generate UMAP embeddings for nodes

snapshots:
  graphml: false
  raw_entities: false
  top_level_nodes: false

local_search:
  # text_unit_prop: 0.5
  # community_prop: 0.1
  # conversation_history_max_turns: 5
  # top_k_mapped_entities: 10
  # top_k_relationships: 10
  # max_tokens: 12000

global_search:
  # max_tokens: 12000
  # data_max_tokens: 12000
  # map_max_tokens: 1000
  # reduce_max_tokens: 2000
  # concurrency: 32

pdf转markdown,markdown转txt

#测试文档 https://github.com/win4r/mytest/blob/main/book.pdf

pip install marker-pdf

marker_single ./book.pdf ./pdftxt --batch_multiplier 2 --max_pages 60 --langs English

#markdown转txt
python markdown_to_text.py book.md book.txt

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1936635.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

升级pnpm 升级node.js 解决安装nodejs多版本时显示 is not yet released or available

第一部分&#xff1a;升级pnpm 1、使用命令查看本地安装的pnpm版本 pnpm -v2 使用命令安装指定版本的pnpm npm install -g pnpm8.9.0也可以使用以下命令安装最新版本的pnpm: npm install -g pnpmlatest安装后可以使用pnpm -v 查看是否升级成功 第二部分&#xff1a;升级n…

非线性支持向量机(SVM)

理论知识推导 支持向量机&#xff08;SVM&#xff09;是一种用于分类和回归分析的监督学习模型。在处理非线性数据时&#xff0c;线性SVM可能无法很好地分离数据。为了解决这个问题&#xff0c;我们使用核函数将低维空间的非线性数据映射到高维空间&#xff0c;使得在高维空间…

邵楠:数据湖存储的现状和未来趋势

近几年数据湖的概念非常火热&#xff0c;但是数据湖的定义并不统一&#xff0c;我们先看下数据湖的相关定义。 Wikipedia对数据湖的定义&#xff1a; 数据湖是指使用大型二进制对象或文件这样的自然格式储存数据的系统。它通常把所有的企业数据统一存储&#xff0c;既包括源系…

生产力工具|Endnote 21 Macwin版本安装

一、软件下载&#xff1a; &#xff08;一&#xff09;mac版本 Endnote 21版本下载&#xff1a;点击下载 Endnote 20版本下载&#xff1a;点击下载 Endnote X9版本下载&#xff1a;点击下载 &#xff08;二&#xff09;Endnote 20 Win版本 第一步&#xff1a;安装好官网软…

分享:一次性查找多个PDF文件,如何根据txt文本列出的文件名批量查找指定文件夹里的文件,并复制到新的文件夹,不需要写任何代码,点点鼠标批量处理一次性搞定

简介&#xff1a; 该文介绍了一个批量查找PDF文件&#xff08;不限于找PDF&#xff09;的工具&#xff0c;用于在多级文件夹中快速查找并复制特定文件。用户可以加载PDF库&#xff0c;输入文件名列表&#xff0c;设置操作参数&#xff08;如保存路径、复制或删除&#xff09;及…

树莓派4B从装系统raspbian到vscode远程编程(python)

1、写在前面 前面用的一直是Ubuntu系统&#xff0c;但是遇到一个奇葩的问题&#xff1a; 北通手柄在终端可以正常使用&#xff0c;接收到数据 但在python程序中使用pygame库初始化时总是报错&#xff1a;Invalid device number&#xff0c;检测不到手柄 经过n次重装系统&am…

【.NET全栈】ASP.NET开发Web应用——计算器

文章目录 一、简单计算器二、复杂计算器 一、简单计算器 新建Web应用项目&#xff0c;窗体页面 窗体设计代码&#xff1a; <% Page Language"C#" AutoEventWireup"true" CodeBehind"Default.aspx.cs" Inherits"AdoDemo.Default"…

打造智慧图书馆:AI视频技术助力图书馆安全与秩序管理

一、背景需求 随着信息技术的飞速发展&#xff0c;图书馆作为重要的知识传播场所&#xff0c;其安全管理也面临着新的挑战。为了确保图书馆内书籍的安全、维护读者的阅读环境以及应对突发事件&#xff0c;TSINGSEE青犀旭帆科技基于EasyCVR视频监控汇聚平台技术与AI视频智能分析…

《0基础》学习Python——第十九讲__爬虫\<2>

一、用get请求爬取一般网页 首先由上节课我们可以找到URL、请求方式、User-Agent以及content-type 即&#xff1a;在所在浏览器页面按下F12键&#xff0c;之后点击网路-刷新&#xff0c;找到第一条双击打开标头即可查看上述所有内容&#xff0c;将上述URL、User-Agent所对应的…

WGS84经纬度坐标 GCJ02火星坐标 BD09百度坐标互相转换

WGS84经纬度坐标 GCJ02火星坐标 BD09百度坐标互相转换 背景&#xff1a;uniapp做的微信小程序&#xff0c;使用到了相机拍照并获取位置坐标信息&#xff1b;在腾讯地图上展示坐标点位置信息&#xff1b; 由于业务需要我们的PC端用的不是腾讯地图&#xff0c;需要使用WGS84坐标或…

目标检测 | YOLO v1、YOLO v2、YOLO v3与YOLO v3 SPP理论讲解

☀️教程&#xff1a;霹雳吧啦Wz ☀️链接&#xff1a;https://www.bilibili.com/video/BV1yi4y1g7ro?p1&vd_sourcec7e390079ff3e10b79e23fb333bea49d 一、YOLO v1 针对于two-stage目标检测算法普遍存在的运算速度慢的缺点&#xff0c;YOLO创造性的提出了one-stage目标检测…

Jupyter notebook如何快速的插入一张图片?如何控制插入图片的缩放、靠左展示(ChatGPT)

在Jupyter Notebook中&#xff0c;你可以使用Markdown语法快速插入图片&#xff0c;并且可以通过HTML标签来控制图片的展示方式和缩放。 注意&#xff1a;以下所有操作都有一个前提&#xff0c;即选择Cell-CellType-Markdown 1. 快速插入图片 要在Jupyter Notebook中插入图…

【Langchain大语言模型开发教程】模型、提示和解析

&#x1f517; LangChain for LLM Application Development - DeepLearning.AI 学习目标 1、使用Langchain实例化一个LLM的接口 2、 使用Langchain的模板功能&#xff0c;将需要改动的部分抽象成变量&#xff0c;在具体的情况下替换成需要的内容&#xff0c;来达到模板复用效…

JavaEE (1)

web开发概述 所谓web开发,指的是从网页中向后端程序发送请求,与后端程序进行 交互. 流程图如下 Web服务器是指驻留于因特网上某种类型计算机的程序. 可以向浏览器等Web客户端提供文档&#xff0c;也可以放置网站文件&#xff0c;让全世界浏览&#xff1b; 它是一个容器&…

新时代:让中药煎制自动化、信息化

新时代&#xff1a;让中药煎制自动化、信息化 现代医疗领域&#xff0c;科技创新始终在为传统医疗服务带来革命性的改进。某行业医疗巨头&#xff0c;一家拥有国家专利100多项的创新型企业&#xff0c;不仅推出了多款中药煎药包装设备&#xff0c;还自主研发了一系列医疗健康体…

tailwindcss——vscode好用的插件

tailwindcss极大的减少了css的书写&#xff0c;提升了开发效率。这个插件也特别好用。 Tailwind CSS IntelliSense

【电子数据取证】关于CoblatStrike的流量特征取证分析

文章关键词&#xff1a;电子数据取证、流量分析、流量取证 一、前言 近期&#xff0c;网络安全团队在对公司内部网络进行安全检查时发现&#xff0c;有五台电脑出现了不明的网络流量。这些电脑并没有执行任何明显的操作&#xff0c;但是网络流量却显示它们正在向外传输数据。…

如何使用 Java 框架监控和反馈持续交付状态

如何使用 Java 框架监控和反馈持续交付状态 在持续交付 (CD) 流程中&#xff0c;及时监控和反馈是至关重要的。通过实时获取有关构建、部署和测试的反馈&#xff0c;团队可以迅速发现并解决问题&#xff0c;从而改善软件质量和缩短交付周期。 Java 框架 Java 生态系统提供了…

django学习入门系列之第四点《写JavaScript的位置选择》

文章目录 往期回顾 位置1&#xff1a;head标签的尾部位置2&#xff1a;body标签的尾部 一般推荐放位置二&#xff08;无论是文件导入还是直接写&#xff09; 往期回顾 1.【快速开发网站】 2.【浏览器能识别的标签1】 3.【浏览器能识别的标签2】 4.【浏览器能识别的标签3】 5…

Linux云计算 |【第一阶段】SERVICES-DAY4

主要内容&#xff1a; DHCP概述、PXE批量装机、配置PXE引导、Kickstart自动应答、Cobbler装机平台 一、DHCP服务概述及原理 DHCP动态主机配置协议&#xff08;Dynamic Host Configuration Protocol&#xff09;&#xff0c;由IETF&#xff08;Internet网络工程师任务小组&…