Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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。
- Host: GitHub
- URL: https://github.com/rgbyang/rag
- Owner: rgbyang
- License: other
- Created: 2024-07-05T15:22:14.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-07T13:55:36.000Z (6 months ago)
- Last Synced: 2024-11-11T07:46:38.817Z (2 months ago)
- Topics: embedding, faiss, hugging-face, knowledge-base, llm, rag, torch, transformers, vectorization
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 LicenseFor more details, see the [LICENSE](LICENSE) file.