LLama 2 + PEFT Docs: CODE interactive LLM w/ RAG
5.6 هزار بار بازدید -
10 ماه پیش
-
A complete code tutorial to
A complete code tutorial to integrate new, external knowledge from webpages to a LLM (LLama 2 70B) in order to improve the accuracy of answers given by the AI. By Retrieval Augmented Generation (RAG) to improve the response of any AI.
RAG based information added in the form of an ICL prompt to LLama 2.
RAG and LLM Integration: A Comprehensive Coding Guide for AI Enthusiasts.
Building Intelligence: A Programmer's Guide to Retrieval-Augmented Generation in LLMs.
LLama 2 + PEFT Manual: Code an interactive Gen AI w/ RAG
Augment the basic knowledge of an AI /LLM with up-to-date date data and information from trusted sources of the internet.
No LangChain, no LLamaIndex, no vector stores. Just pure code.
We'll use ChatGPT to scrape the PEFT documentation using scrapy and BeautifulSoap, chunk it, embed the chunks in a new vector space using sentence-transformers, create index using hnswlib and loading the search index and utils for embedding user query. Similarity search is performed in this vector space to find the TOP10 best answers, given our body of external knowledge. Then we use a cross-encoder for the reranking of the semantic similarity and feed the best answers back into our LLM, to augment the ICL prompt to LLAMA 2.
Code sources (all rights with original authors):
https://huggingface.co/spaces/smangru...
https://huggingface.co/spaces/smangru...
https://chat.openai.com/share/eb3079b...
#coding
#ai
#huggingface
RAG based information added in the form of an ICL prompt to LLama 2.
RAG and LLM Integration: A Comprehensive Coding Guide for AI Enthusiasts.
Building Intelligence: A Programmer's Guide to Retrieval-Augmented Generation in LLMs.
LLama 2 + PEFT Manual: Code an interactive Gen AI w/ RAG
Augment the basic knowledge of an AI /LLM with up-to-date date data and information from trusted sources of the internet.
No LangChain, no LLamaIndex, no vector stores. Just pure code.
We'll use ChatGPT to scrape the PEFT documentation using scrapy and BeautifulSoap, chunk it, embed the chunks in a new vector space using sentence-transformers, create index using hnswlib and loading the search index and utils for embedding user query. Similarity search is performed in this vector space to find the TOP10 best answers, given our body of external knowledge. Then we use a cross-encoder for the reranking of the semantic similarity and feed the best answers back into our LLM, to augment the ICL prompt to LLAMA 2.
Code sources (all rights with original authors):
https://huggingface.co/spaces/smangru...
https://huggingface.co/spaces/smangru...
https://chat.openai.com/share/eb3079b...
#coding
#ai
#huggingface
10 ماه پیش
در تاریخ 1402/08/11 منتشر شده
است.
5,616
بـار بازدید شده