オフラインで使用するために設計されたこのRAGアプリケーションテンプレートは、Andrej Baranovskijのチュートリアルに基づいています。オンラインAPIやOpenAIなどのクラウドベースのLLMサービスとは無関係に、独自のローカルラグパイプラインを構築するための出発点を提供します。これにより、開発者は制御された環境でRAGアプリケーションを実験および展開することができます。
Create-llamaを使用して生成され、このプロジェクト用にカスタマイズされたフルスタックUIアプリケーションは、https://github.com/tyrell/llm-ollama-llamaindex-bootstrap-uiにあります
私のブログ投稿は、これらのプロジェクトの背後にあるより多くのコンテキスト、動機、考え方を提供します。
このRAGアプリケーションは完全にオフラインで実行され、ローカルCPUを利用して、インターネットアクセスを必要とせずに応答を生成/ランク付けします。このぼろきれの展開は、計算のためにローカルCPUのみに依存しています。大規模なデータセットの処理またはリソース集約型モデルを使用すると、パフォーマンスが低下する可能性があることに注意してください。
docker compose up -d
pip install -r requirements.txt
Ollamaをインストールし、Config.ymlで指定された優先LLMモデルをプルします
テキストPDFファイルをdataフォルダーにコピーします
スクリプトを実行して、テキストをベクトルの埋め込みに変換し、織りで保存します。
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
Templateアプリケーションをテストするために、prosps.txtでより多くのプロンプトを見つけることができます。コードベースを読んだら、特定のニーズに合わせてぼろを拡張します。
Apache 2.0
〜Tyrell Perera