リポジトリの概要
このリポジトリは、ベクトルデータベースであるChroma DBの統合を示しており、埋め込みモデルを埋め込み、堅牢な回収拡張生成(RAG)システムを開発します。
埋め込みモデルオプション
再ランカー統合(HTTP、GRPC)
RAGの精度を向上させるために、Huggingfaceの再ランカーモデルを組み込むことができます。これらのモデルは、VectordBから取得されたクエリとクエリの結果の類似性を評価し、再ランカーをインデックスごとに再ランカーにランク付けし、取得した情報が関連性があり、文脈的に正確であることを保証します。
Example:
query := " What is Deep Learning? "
retrievedResults := []string{ " Tomatos are fruits... " , " Deep Learning is not... " , " Deep learning is... " }
Response: [{ " index " :2, " score " :0.9987814},{ " index " :1, " score " :0.022949383},{ " index " :0, " score " :0.000076250595}]このリポジトリは、埋め込みと再ランキングを組み合わせてRAGシステムを開発する方法を示しています。
ベクトルデータベースのセットアップ:
プリプロースドキュメント:
埋め込みを保存:
クエリ処理:
LLMプロバイダーとの統合:
プロンプトテンプレートを作成します:
LLMでのプロセス:
これにより、ベクトルデータベースと高度な埋め込みモデルのパワーを活用することにより、言語処理タスクを強化できます。
<|user|> what is mirostat_tau?</s>:-
Based on the provided content, I can answer your query.
** Query Result: ** Mirostat_tau Controls the balance between coherence and diversity of the output. A lower value will result in more focused and coherent text. (Default: 5.0)
** Document Content: **
mirostat_tau Controls the balance between coherence and diversity of the output. A lower value will result in more focused and coherent text. (Default: 5.0)
float
mirostat_tau 5.0
** Additional Information on this Topic: **
Here are three main points related to Mirostat_tau:
1. ** Coherence vs Diversity: ** Mirostat_tau controls the balance between coherence and diversity of the output, which means it determines how focused or creative the generated text will be.
2. ** Lower Values Mean More Focus: ** A lower value for mirostat_tau results in more focused and coherent text, while a higher value allows for more diverse and potentially less coherent output.
3. ** Default Value: ** The default value for Mirostat_tau is 5.0, which means that if no specific value is provided, the model will generate text with a balance between coherence and diversity.
Please note that these points are based solely on the provided content and do not go beyond it.% git clone https://github.com/yourusername/chroma-db.git
cd chroma-dbgo build -o chroma-db cmd/main.goDockerとDocker Composeがインストールされていることを確認してください。 docker-compose.yamlを使用して、Chroma DBサービスをセットアップします。
docker-compose up -d./chroma-db
Usage
-load
Load and embed the data in vectordb
Provide the path to file Eg: " test/model_params.txt "
-query
Query the embedded data and rerank the results
Provide the query Eg: " what is the difference between mirostat_tau and mirostat_eta? " CMD/ :
内部/定数/ :
docker-compose.yaml :dockerは、Chroma DBサービスをセットアップするための構成ファイルを作成します。
ニーズに合わせて、 internal/constants/constants.goの構成値を調整します。これには、次のような設定が含まれます。
Chroma DB URL、テナント名、データベース、名前空間。オラマモデルタイプとURL。
< | system | > {{ . SystemPrompt }} < / s >
< | content | > {{ . Content }} < / s >
< | user | > {{ . Prompt }} < / s > 次のコマンドでVectordBを開始します。
docker compose upチャット関連操作を実行します:
go run ./cmd/main.goデフォルトの構成値はinternal/constants/constants.goで提供され、ニーズに応じて調整できます。これらのいくつかは次のとおりです。
ChromaUrl 、 TenantName 、 Database 、 NamespaceOllamaModelとOllamaUrlこのプロジェクトは、BSD 3 -Clauseライセンスの下でライセンスされています - 詳細については、ライセンスファイルを参照してください。
問題や貢献については、問題を開き、GitHubにプルリクエストを送信してください。