Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rgbyang/rag

A basic LLM application as knowledge base. You can have the LLM answer your questions from the context you provide. Main steps: vectorization (embedding), RAG. 一个基本的知识库类型大语言模型应用。你可以让大模型从你提供的上下文中回答你的提问。主要步骤:向量化(内嵌),RAG。
https://github.com/rgbyang/rag

embedding faiss hugging-face knowledge-base llm rag torch transformers vectorization

Last synced: 9 days ago
JSON representation

A basic LLM application as knowledge base. You can have the LLM answer your questions from the context you provide. Main steps: vectorization (embedding), RAG. 一个基本的知识库类型大语言模型应用。你可以让大模型从你提供的上下文中回答你的提问。主要步骤:向量化(内嵌),RAG。

Awesome Lists containing this project

README

        

\[ English | [中文](README_zh.md) \]

## Overview

- A basic LLM (Large Language Model) application as knowledge base. To help you to understand the basic workflow and funcitons of this type application of LLM.
- You can have the LLM answer your questions from the context you provide.
- Main steps: vectorization (embedding), RAG (Retrieval-augmented Generation).

## Environment

- OS: Windows.
- Hardware: GPU is not required.
- Software: Python and the related packages.

## Getting Started

1. Run "Vectorization.py" to vectorize (embedding) your context and save it to local "embeddingsBert.npy" and "chunksBert.txt".
2. Run "RAG.py" to load "embeddingsBert.npy" and "chunksBert.txt" to memory, make index for the embeddings, vectorize (embedding) your question, search related content to your question from the index, generate and output the anwswer to the CLI terminal.
3. You can specify your context in "context.py", and specify your quesiton by changing the value of "question" in "RAG.py".

## License

This project is licensed under the Apache License 2.0.

### Third-Party Licenses

This project uses the following third-party libraries:

- **Library transformers**: Licensed under the Apache License 2.0
- **Library numpy**: Licensed under the BSD License
- **Library torch**: Licensed under the BSD License
- **Library faiss**: Licensed under the MIT License
- **Library colorama**: Licensed under the BSD License

For more details, see the [LICENSE](LICENSE) file.