Spaces:
Running
Running
A newer version of the Gradio SDK is available:
5.20.0
metadata
title: Rag
emoji: 🐢
colorFrom: gray
colorTo: indigo
sdk: gradio
sdk_version: 5.12.0
app_file: app.py
pinned: false
short_description: Just another rag but with Images 🖼️
Just another RAG, dont bother much!!
File Descriptions
z_document_reader.py
Images are only useful to limited resource computer if it has a caption. So this file helps parse the wikipedia html strips it off the tags.
z_embedding.py
Generates vector store.
z_generate.py
Use LLM and prompting to find the relevant texts and images stored in the vector stores.
Adding more data sources
Currently limited to wikipedia pages downloaded as HTML.
- Place the html in the folder
_data
- Run command
python z_embedding.py
- Output will be two FAISS vectors stores in the folder
cache_vector...
Local Debug
Highly recommend VS Code, makes life easy.
Create Virtual environment with name
sb-rag
using the below commandpython -m venv sb-rag
Activate the environemnt (create new terminal VS Code to automatically do so)
Edit
.vscode/launch.json
. Fill in the environment variableHF_SERVERLESS_API
.Start VS Code debugger.
References
- UI Blocks Concepts: https://huggingface.co/learn/nlp-course/en/chapter9/7
- UI Row-Column Arrangement: https://www.gradio.app/guides/controlling-layout
- Show caption in image gallery: https://github.com/gradio-app/gradio/issues/3364
- HF Implementation of basic: https://huggingface.co/learn/cookbook/en/advanced_rag
- https://python.langchain.com/docs/integrations/vectorstores/faiss/
Ideas
- Shows frames of design patterns: https://www.falkordb.com/blog/advanced-rag/
- HF Implementation of basic: https://huggingface.co/learn/cookbook/en/advanced_rag
- HF RAG Evaluation: https://huggingface.co/learn/cookbook/en/rag_evaluation
- HF Implementation by someone: https://medium.aiplanet.com/advanced-rag-implementation-on-custom-data-using-hybrid-search-embed-caching-and-mistral-ai-ce78fdae4ef6
- HF Agentic Rag: https://huggingface.co/learn/cookbook/en/agent_rag
- Future read, tooning https://huggingface.co/blog/lucifertrj/finetune-embeddings
- Opinion on instruct embeddings: https://huggingface.co/blog/Tonic/instruct-embeddings-and-advanced-rag
- Another Implementation: https://huggingface.co/learn/cookbook/en/rag_zephyr_langchain
- Another Opinion on ray: https://www.anyscale.com/blog/retrieval-augmented-generation-with-huggingface-transformers-and-ray
- Ray Follow up: https://github.com/run-llama/ai-engineer-workshop/blob/main/presentation.pdf?__s=2il5g6hpfc4mtmydioir
- llama Index rag implementation: https://docs.llamaindex.ai/en/latest/optimizing/production_rag/
- Just some termino book: https://www.projectpro.io/article/advanced-rag-techniques/1063
- Another Evaluation Guide: https://pub.towardsai.net/evaluating-rag-metrics-across-different-retrieval-methods-770aa01380c8
- Oracle Garbage: https://blogs.oracle.com/ai-and-datascience/post/ai-health-mixtral-oracle-23ai-rag-langchain-streamlit