首页 > 其他分享 >RAG Project with Ollama and LangChain via Gradio Interface

RAG Project with Ollama and LangChain via Gradio Interface

时间:2024-05-16 23:19:01浏览次数:15  
标签:RAG via language Gradio langchain LangChain Ollama

RAG Project with Ollama and LangChain via Gradio Interface

https://github.com/fanqingsong/rag-ollama-langchain

This repository hosts the implementation of a Retrieval-Augmented Generation (RAG) project leveraging the capabilities of Ollama to run open-source large language models (LLMs) locally, alongside LangChain for robust integration of language models with data retrieval functionalities. A Gradio interface is provided for easy and interactive user engagement.
Project Overview

Retrieval-Augmented Generation (RAG) combines the generative strengths of large language models with advanced information retrieval techniques to produce contextually rich and accurate outputs. This project showcases the power of RAG in various domains such as question answering, content creation, and data synthesis, by harnessing the latest in language modeling and retrieval technologies through Ollama and LangChain.
Features

    Ollama Integration: Uses Ollama to locally run various open-source large language models, including Llama 2 and Code Llama, offering state-of-the-art language understanding and generation.
    LangChain for Efficient Retrieval: Implements LangChain for effective retrieval of pertinent information from diverse data sources, enhancing the models' output with real-time data.
    Interactive Gradio Interface: Provides a Gradio-based web interface for real-time user interaction, making it straightforward for both technical and non-technical users to input queries and receive responses.
    Flexible Framework: Designed for easy extension across different use cases and data sets, facilitating broad applicability.

 

demo

使用 docker-compose up 运行3个services (rag application / ollama / ollama webui)

在ollama webui上下载  千问模型  qwen:0.5b

访问 rag application web 界面,

输入 url 和 问题

url 为  https://zhuanlan.zhihu.com/p/675924232

点击运行, 等待数分钟后, 右侧outputs给出响应。

 

 

https://api.python.langchain.com/en/latest/chains/langchain.chains.retrieval_qa.base.RetrievalQA.html#langchain.chains.retrieval_qa.base.RetrievalQA

https://api.python.langchain.com/en/stable/community_api_reference.html#module-langchain_community.embeddings

https://zhuanlan.zhihu.com/p/668082024

 

标签:RAG,via,language,Gradio,langchain,LangChain,Ollama
From: https://www.cnblogs.com/lightsong/p/18196970

相关文章

  • 在langchain中的rag学习使用之旅-从半知半解到实现效果
    rag我简单理解来看就是我先有一段文本,先把它转成向量,保存到向量数据库中,下次我调用llm时将向量数据库中查询的结果给llm作参考并回答。对rag了解不多,所以开启学习之旅,学完了要应用到实际的需求中,因为最近手里有一个订单就是需要用到这个技术,但是又一知半解。现在新知识太多了,学......
  • 精通RAG架构:从0到1,基于LLM+RAG构建生产级企业知识库
    文章很长,且持续更新,建议收藏起来,慢慢读!疯狂创客圈总目录博客园版为您奉上珍贵的学习资源:免费赠送:《尼恩Java面试宝典》持续更新+史上最全+面试必备2000页+面试必备+大厂必备+涨薪必备免费赠送:《尼恩技术圣经+高并发系列PDF》,帮你实现技术自由,完成职业升级,薪......
  • RAG学习--pdf读取
    RAG流程:线下:1、文档加载2、文档切分3、向量化4、向向量数据库灌数据线上:1、获取用户问题2、用户问题向量化3、检索向量数据库4、将检索结果和问题填充到pomp模板5、用最终获得的pomp调用LLM6、最终由LLM生成回复本篇完成文档加载与切割(pdf加载与切割)1、文档加载......
  • SystemVerilog -- 10.0 SystemVerilog Functional Coverage
    SystemVerilogFunctionalCoverageWhatisfunctionalcoverage?functionalcoverage是测试对设计的哪些功能/特性的衡量。这在约束随机验证(CRV)中非常有用,可以了解回归中的一组测试涵盖了哪些特征。Whatareitslimitations?这仅与为它编写的代码一样好。假设您在设计文档......
  • gradio 将 webui 从 127.0.0.1 映射到局域网 IP
    在局域网中,假设当前用Python调试gradiowebui的设备IP地址是192.168.1.101,若app.py内容如下:importgradioasgrwithgr.Blocks()asdemo:#TODO:demo.launch(server_name="0.0.0.0")运行即可实现将127.0.0.1:7860映射到192.168.1.101:7860其实是launch......
  • Outrageously Large Neural Networks The Sparsely-Gated Mixture-of-Experts Layer
    目录概MoE训练ShazeerN.,MirhoseiniA.,MaziarzK.,DavisA.,LeQ.,HintonG.andDeanJ.Outrageouslylargeneuralnetworks:Thesparsely-gatedmixture-of-expertslayer.ICLR,2017.概Mixture-of-Experts(MoE).MoE通过一gatingnetwork选择不同的exp......
  • Gradio 和 Streamlit
    Gradio和Streamlit都是用于创建机器学习模型的Web界面的Python库,但它们的设计哲学和特性有所不同。以下是对这两个库的简要比较:Gradio:Gradio是一个用于快速为机器学习模型创建简单Web界面的库。它允许用户轻松地将输入数据发送到模型,并接收预测结果。Gradio的界面简......
  • 2024CVPR_Low-light Image Enhancement via CLIP-Fourier Guided Wavelet Diffusion(C
    一、Motivation1、单模态监督问题:大多数方法往往只考虑从图像层面监督增强过程,而忽略了图像的详细重建和多模态语义对特征空间的指导作用。这种单模态监督导致不确定区域的次优重建和较差的局部结构,导致视觉结果不理想的出现。------》扩散模型缺乏有效性约束,容易出现多种生成效......
  • UEC++做拖拽时的UDragDropOperation 的PayLoad是什么
    在UnrealEngine中,使用C++进行拖拽操作时,UDragDropOperation类的Payload成员变量允许你传递与拖拽操作相关的任何类型的数据。它通常被用来存储一些关于被拖拽元素的信息,这些信息在拖拽开始时被设置,然后可以在拖拽结束时被检索和使用。Payload是一个UObject*类型的指针,这意......
  • AI 数据观 | TapData Cloud + MongoDB Atlas:大模型与 RAG 技术有机结合,落地实时工单处
    本篇为「AI数据观」系列文章第二弹,在这里,我们将进一步探讨AI行业的数据价值。以RAG的智能工单应用场景为例,共同探索如何使用TapdataCloud+MongoDBAtlas实现具备实时更新能力的向量数据库,为企业工单处理的智能化和自动化需求,提供准实时的新鲜数据。完整分布教程指引,详见......