모델 수정

This commit is contained in:
2025-03-12 11:45:29 +09:00
parent 920579046f
commit 0b7df4089e
2 changed files with 7 additions and 7 deletions

View File

@@ -1,11 +1,11 @@
services:
rag_test:
rag_streamlit_test:
build: .
volumes:
- .:/opt/workspace # 로컬 디렉토리와 컨테이너 디렉토리 동기화
ports:
- "8502:8501" # Streamlit 앱 포트 설정
container_name: rag_test # 컨테이너 이름 설정
- "8504:8501" # Streamlit 앱 포트 설정
container_name: rag_streamlit_test # 컨테이너 이름 설정
deploy:
resources:
reservations:

View File

@@ -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 테스트")