오프라인 사용을 위해 설계된이 RAG 응용 프로그램 템플릿은 Andrej Baranovskij의 자습서를 기반으로합니다. 온라인 API 및 OpenAI와 같은 클라우드 기반 LLM 서비스와 무관하게 자신의 로컬 래그 파이프 라인을 구축하기위한 출발점을 제공합니다. 이를 통해 개발자는 통제 된 환경에서 RAG 응용 프로그램을 실험하고 배치 할 수 있습니다.
Create-Llama를 사용하여 생성 되고이 프로젝트에 맞는 FullStack UI 응용 프로그램은 https://github.com/tyrell/llm-llama-llamaindex-bootstrap-ui에서 찾을 수 있습니다.
내 블로그 게시물은 이러한 프로젝트의 더 많은 맥락, 동기 부여 및 사고를 제공합니다.
이 RAG 응용 프로그램은 인터넷 액세스가 필요없이 로컬 CPU를 사용하여 응답을 생성/검색/순위를 생성하기 위해 완전히 오프라인으로 실행됩니다. 이 RAG 배치는 계산을 위해 로컬 CPU에만 의존합니다. 대규모 데이터 세트를 처리하거나 리소스 집약적 인 모델을 사용하면 성능이 느려질 수 있습니다.
docker compose up -d
pip install -r requirements.txt
Ollama를 설치하고 config.yml에 지정된 선호하는 LLM 모델을 당기십시오.
텍스트 PDF 파일을 data 폴더에 복사하십시오
스크립트를 실행하여 텍스트를 벡터 임베딩으로 변환하고 weaviate를 저장하십시오.
python ingest.py
python main.py "Who are you?"
답변:
Answer:
I am an AI language model, designed to assist and provide information based on the context provided. In this case, the context is related to an invoice from Chapman, Kim and Green to Rodriguez-Stevens for various items such as wine glasses, stemware storage, corkscrew parts, and stemless wine glasses.
Here are some key details from the invoice:
- Invoice number: 61356291
- Date of issue: 09/06/2012
- Seller: Chapman, Kim and Green
- Buyer: Rodriguez-Stevens
- VAT rate: 10%
The invoice includes several items with their respective quantities, unit measures (UM), net prices, net worth, gross worth, and taxes. The summary section provides the total net worth, VAT amount, and gross worth of the invoice.
==================================================
Time to retrieve answer: 37.36918904201593
Prompts.txt에서 더 많은 프롬프트를 찾아 템플릿 응용 프로그램을 테스트 할 수 있습니다. 코드베이스를 통해 읽은 후에는 헝겊을 특정 요구 사항으로 확장하십시오.
아파치 2.0
~ Tyrell Perera