모델 수정
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
services:
|
services:
|
||||||
rag_test:
|
rag_streamlit_test:
|
||||||
build: .
|
build: .
|
||||||
volumes:
|
volumes:
|
||||||
- .:/opt/workspace # 로컬 디렉토리와 컨테이너 디렉토리 동기화
|
- .:/opt/workspace # 로컬 디렉토리와 컨테이너 디렉토리 동기화
|
||||||
ports:
|
ports:
|
||||||
- "8502:8501" # Streamlit 앱 포트 설정
|
- "8504:8501" # Streamlit 앱 포트 설정
|
||||||
container_name: rag_test # 컨테이너 이름 설정
|
container_name: rag_streamlit_test # 컨테이너 이름 설정
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
reservations:
|
reservations:
|
||||||
|
|||||||
8
main.py
8
main.py
@@ -29,7 +29,7 @@ load_dotenv()
|
|||||||
EMBEDDING_MODEL = "nlpai-lab/KoE5"
|
EMBEDDING_MODEL = "nlpai-lab/KoE5"
|
||||||
RERANK_MODEL = "upskyy/ko-reranker-8k"
|
RERANK_MODEL = "upskyy/ko-reranker-8k"
|
||||||
LOAD_DOCS = "data/fake_rag"
|
LOAD_DOCS = "data/fake_rag"
|
||||||
SAVE_VD = "fake_all"
|
SAVE_VD = "fake_all_KCDS"
|
||||||
|
|
||||||
|
|
||||||
def embedding():
|
def embedding():
|
||||||
@@ -104,12 +104,12 @@ kiwi = Kiwi()
|
|||||||
|
|
||||||
@st.cache_resource
|
@st.cache_resource
|
||||||
def initialize_processing():
|
def initialize_processing():
|
||||||
processed_texts = load_and_process_documents(LOAD_DOCS)
|
|
||||||
docs = processed_texts
|
|
||||||
try:
|
try:
|
||||||
faiss_index = load_faiss_index(SAVE_VD)
|
faiss_index = load_faiss_index(SAVE_VD)
|
||||||
|
docs = list(faiss_index.docstore._dict.values())
|
||||||
except Exception:
|
except Exception:
|
||||||
print("no load_faiss_index")
|
print("no load_faiss_index")
|
||||||
|
docs = load_and_process_documents(LOAD_DOCS)
|
||||||
embeddings = embedding()
|
embeddings = embedding()
|
||||||
faiss_index = FAISS.from_documents(docs, embeddings)
|
faiss_index = FAISS.from_documents(docs, embeddings)
|
||||||
save_faiss_index(faiss_index, SAVE_VD)
|
save_faiss_index(faiss_index, SAVE_VD)
|
||||||
@@ -136,7 +136,7 @@ def initialize_processing():
|
|||||||
|
|
||||||
|
|
||||||
# GPT 모델 설정
|
# 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.set_page_config(page_title="RAG 테스트", page_icon="💬")
|
||||||
st.title("RAG 테스트")
|
st.title("RAG 테스트")
|
||||||
|
|||||||
Reference in New Issue
Block a user