RAG-Pipeline-Optimization / config /gpu /half_openai_korean.yaml
bwook's picture
Upload 23 files
b8a3ef1 verified
node_lines:
- node_line_name: retrieve_node_line # Arbitrary node line name
nodes:
- node_type: retrieval
strategy:
metrics: [ retrieval_f1, retrieval_recall, retrieval_precision,
retrieval_ndcg, retrieval_map, retrieval_mrr ]
speed_threshold: 10
top_k: 10
modules:
- module_type: bm25
bm25_tokenizer: [ ko_kiwi ]
- module_type: vectordb
embedding_model: openai
embedding_batch: 256
- module_type: hybrid_rrf
weight_range: (4,80)
- module_type: hybrid_cc
normalize_method: [ mm, tmm, z, dbsf ]
weight_range: (0.0, 1.0)
test_weight_size: 101
- node_type: passage_augmenter
strategy:
metrics: [ retrieval_f1, retrieval_recall, retrieval_precision ]
speed_threshold: 5
top_k: 5
embedding_model: openai
modules:
- module_type: pass_passage_augmenter
- module_type: prev_next_augmenter
mode: next
- node_type: passage_reranker
strategy:
metrics: [ retrieval_f1, retrieval_recall, retrieval_precision ]
speed_threshold: 10
top_k: 5
modules:
- module_type: pass_reranker
- module_type: tart
- module_type: monot5
- module_type: upr
- module_type: rankgpt
- module_type: colbert_reranker
- module_type: sentence_transformer_reranker
- module_type: flag_embedding_reranker
- module_type: flag_embedding_llm_reranker
- module_type: openvino_reranker
- node_type: passage_filter
strategy:
metrics: [ retrieval_f1, retrieval_recall, retrieval_precision ]
speed_threshold: 5
modules:
- module_type: pass_passage_filter
- module_type: similarity_threshold_cutoff
threshold: 0.85
- module_type: similarity_percentile_cutoff
percentile: 0.6
- module_type: threshold_cutoff
threshold: 0.85
- module_type: percentile_cutoff
percentile: 0.6
- node_type: passage_compressor
strategy:
metrics: [retrieval_token_f1, retrieval_token_recall, retrieval_token_precision]
speed_threshold: 10
modules:
- module_type: pass_compressor
- module_type: tree_summarize
llm: openai
model: gpt-4o-mini
prompt: |
์—ฌ๋Ÿฌ ๋ฌธ๋งฅ ์ •๋ณด๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.\n
---------------------\n
{context_str}\n
---------------------\n
์‚ฌ์ „ ์ง€์‹์ด ์•„๋‹Œ ์—ฌ๋Ÿฌ ์ •๋ณด๊ฐ€ ์ฃผ์–ด์กŒ์Šต๋‹ˆ๋‹ค,
์งˆ๋ฌธ์— ๋Œ€๋‹ตํ•˜์„ธ์š”.\n
์งˆ๋ฌธ: {query_str}\n
๋‹ต๋ณ€:
- module_type: refine
llm: openai
model: gpt-4o-mini
prompt: |
์›๋ž˜ ์งˆ๋ฌธ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค: {query_str}
๊ธฐ์กด ๋‹ต๋ณ€์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค: {existing_answer}
์•„๋ž˜์—์„œ ๊ธฐ์กด ๋‹ต๋ณ€์„ ์ •์ œํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐํšŒ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
(ํ•„์š”ํ•œ ๊ฒฝ์šฐ์—๋งŒ) ์•„๋ž˜์— ๋ช‡ ๊ฐ€์ง€ ๋งฅ๋ฝ์„ ์ถ”๊ฐ€ํ•˜์—ฌ ๊ธฐ์กด ๋‹ต๋ณ€์„ ์ •์ œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
------------
{context_msg}
------------
์ƒˆ๋กœ์šด ๋ฌธ๋งฅ์ด ์ฃผ์–ด์ง€๋ฉด ๊ธฐ์กด ๋‹ต๋ณ€์„ ์ˆ˜์ •ํ•˜์—ฌ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ๋‹ต๋ณ€์„ ์ •์ œํ•ฉ๋‹ˆ๋‹ค.
๋งฅ๋ฝ์ด ์“ธ๋ชจ ์—†๋‹ค๋ฉด, ๊ธฐ์กด ๋‹ต๋ณ€์„ ๊ทธ๋Œ€๋กœ ๋‹ต๋ณ€ํ•˜์„ธ์š”.
์ •์ œ๋œ ๋‹ต๋ณ€:
- module_type: longllmlingua
- node_line_name: post_retrieve_node_line # Arbitrary node line name
nodes:
- node_type: prompt_maker
strategy:
metrics:
- metric_name: bleu
- metric_name: meteor
- metric_name: rouge
- metric_name: sem_score
embedding_model: openai
speed_threshold: 10
generator_modules:
- module_type: llama_index_llm
llm: openai
model: [gpt-4o-mini]
modules:
- module_type: fstring
prompt: ["์ฃผ์–ด์ง„ passage๋งŒ์„ ์ด์šฉํ•˜์—ฌ question์— ๋”ฐ๋ผ ๋‹ตํ•˜์‹œ์˜ค passage: {retrieved_contents} \n\n Question: {query} \n\n Answer:"]
- module_type: long_context_reorder
prompt: ["์ฃผ์–ด์ง„ passage๋งŒ์„ ์ด์šฉํ•˜์—ฌ question์— ๋”ฐ๋ผ ๋‹ตํ•˜์‹œ์˜ค passage: {retrieved_contents} \n\n Question: {query} \n\n Answer:"]
- node_type: generator
strategy:
metrics:
- metric_name: bleu
- metric_name: meteor
- metric_name: rouge
- metric_name: sem_score
embedding_model: openai
speed_threshold: 10
modules:
- module_type: llama_index_llm
llm: [openai]
model: [gpt-4o-mini]
temperature: [0.5, 1.0]