모델 수정
This commit is contained in:
8
main.py
8
main.py
@@ -29,7 +29,7 @@ load_dotenv()
|
||||
EMBEDDING_MODEL = "nlpai-lab/KoE5"
|
||||
RERANK_MODEL = "upskyy/ko-reranker-8k"
|
||||
LOAD_DOCS = "data/fake_rag"
|
||||
SAVE_VD = "fake_all"
|
||||
SAVE_VD = "fake_all_KCDS"
|
||||
|
||||
|
||||
def embedding():
|
||||
@@ -104,12 +104,12 @@ kiwi = Kiwi()
|
||||
|
||||
@st.cache_resource
|
||||
def initialize_processing():
|
||||
processed_texts = load_and_process_documents(LOAD_DOCS)
|
||||
docs = processed_texts
|
||||
try:
|
||||
faiss_index = load_faiss_index(SAVE_VD)
|
||||
docs = list(faiss_index.docstore._dict.values())
|
||||
except Exception:
|
||||
print("no load_faiss_index")
|
||||
docs = load_and_process_documents(LOAD_DOCS)
|
||||
embeddings = embedding()
|
||||
faiss_index = FAISS.from_documents(docs, embeddings)
|
||||
save_faiss_index(faiss_index, SAVE_VD)
|
||||
@@ -136,7 +136,7 @@ def initialize_processing():
|
||||
|
||||
|
||||
# GPT 모델 설정
|
||||
gpt_model = ChatOpenAI(model_name="gpt-4", temperature=0)
|
||||
gpt_model = ChatOpenAI(model_name="gpt-4o-mini", temperature=0)
|
||||
|
||||
st.set_page_config(page_title="RAG 테스트", page_icon="💬")
|
||||
st.title("RAG 테스트")
|
||||
|
||||
Reference in New Issue
Block a user