Downloads · 30 days
0
tush1507/my-rag-system
my-rag-system is a machine learning model from tush1507. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains a Retrieval-Augmented Generation (RAG) system with:
Downloads · 30 days
0
Access
Public
Updated Apr 13, 2025
Repo size
5.5 MB
Likes
0
Public
Click a slice to open those files.
.pkl2.9 MB · 50%
From the Hugging Face model README
This repository contains a Retrieval-Augmented Generation (RAG) system with:
from huggingface_hub import hf_hub_download
from langchain.vectorstores import FAISS
from langchain_community.embeddings import HuggingFaceEmbeddings
import json
import os
# Download the vector database and config
vector_db_path = hf_hub_download(repo_id="tush1507/my-rag-system", repo_type="model", filename="vector_database/index.faiss")
vector_db_dir = os.path.dirname(vector_db_path)
config_path = hf_hub_download(repo_id="tush1507/my-rag-system", repo_type="model", filename="config/embedding_config.json")
# Load the embedding configuration
with open(config_path, 'r') as f:
embedding_config = json.load(f)
# Create the embedding model
embedding_model = HuggingFaceEmbeddings(
model_name=embedding_config["model_name"],
encode_kwargs={"normalize_embeddings": embedding_config.get("normalize_embeddings", True)}
)
# Load the vector database
knowledge_base = FAISS.load_local(vector_db_dir, embedding_model)
# Search for similar documents
query = "Your question here"
docs = knowledge_base.similarity_search(query, k=5)
# Now process with your preferred LLM
# [Your LLM code here]