diff --git a/pages/3_gene_question.py b/pages/3_gene_question.py index 3e0a8d8..5c56754 100644 --- a/pages/3_gene_question.py +++ b/pages/3_gene_question.py @@ -26,7 +26,7 @@ from src.rule_based import list_extend_questions_based_on_keywords from src.util import local_css, read_prompt_from_txt from src.semantic_search import faiss_inference, reranker -from config import OPENAI_API_KEY, DATA_DIR, IMG_PATH, CSS_PATH, PORT +from config import OPENAI_API_KEY, DATA_DIR, IMG_PATH, CSS_PATH, PORT, MODEL_NAME st.session_state["FAV_IMAGE_PATH"] = os.path.join(IMG_PATH, "favicon.png") st.set_page_config( @@ -80,8 +80,6 @@ """,unsafe_allow_html=True) -## set variables -MODEL_NAME = "gpt-3.5-turbo-16k" ## set save dir USER_RESUME_SAVE_DIR = os.path.join(st.session_state["save_dir"], "2_generate_question_user_resume.pdf") diff --git a/pages/3_gene_question_no_resume.py b/pages/3_gene_question_no_resume.py index f5745e5..d50194f 100644 --- a/pages/3_gene_question_no_resume.py +++ b/pages/3_gene_question_no_resume.py @@ -27,7 +27,7 @@ from src.rule_based import list_extend_questions_based_on_keywords from src.util import local_css, read_prompt_from_txt from src.semantic_search import faiss_inference, reranker -from config import OPENAI_API_KEY, DATA_DIR, IMG_PATH, CSS_PATH, PORT +from config import OPENAI_API_KEY, DATA_DIR, IMG_PATH, CSS_PATH, MODEL_NAME st.session_state["FAV_IMAGE_PATH"] = os.path.join(IMG_PATH, "favicon.png") st.set_page_config( @@ -81,8 +81,6 @@ """,unsafe_allow_html=True) -## set variables -MODEL_NAME = "gpt-3.5-turbo-16k" ## set save dir USER_RESUME_SAVE_DIR = os.path.join(st.session_state["save_dir"], "2_generate_question_user_resume.pdf") diff --git a/pages/4_show_questions_hint.py b/pages/4_show_questions_hint.py index 59aa416..3be227e 100644 --- a/pages/4_show_questions_hint.py +++ b/pages/4_show_questions_hint.py @@ -12,7 +12,7 @@ from src.generate_question import (create_prompt_feedback, # 추가 create_prompt_hint) from src.util import read_prompt_from_txt -from config import DATA_DIR, IMG_PATH, OPENAI_API_KEY +from config import DATA_DIR, IMG_PATH, OPENAI_API_KEY, MODEL_NAME st.session_state["FAV_IMAGE_PATH"] = os.path.join(IMG_PATH, "favicon.png") st.set_page_config( @@ -23,8 +23,6 @@ layout="wide", initial_sidebar_state="collapsed", ) -#MODEL_NAME = "gpt-4-0125-preview" -MODEL_NAME = "gpt-3.5-turbo-16k" NEXT_PAGE = "introduction" st.session_state.logger.info("start show_questions page") diff --git a/src/gene_question_2chain_ver.py b/src/gene_question_2chain_ver.py index 506ea76..b591674 100644 --- a/src/gene_question_2chain_ver.py +++ b/src/gene_question_2chain_ver.py @@ -20,7 +20,7 @@ from streamlit_extras.switch_page_button import switch_page from util import local_css, read_prompt_from_txt -from config import OPENAI_API_KEY # OPENAI_API_KEY 불러오기 +from config import OPENAI_API_KEY, MODEL_NAME DATA_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data") st.session_state["FAV_IMAGE_PATH"] = os.path.join(DATA_DIR, "images/favicon.png") @@ -109,9 +109,6 @@ # """, unsafe_allow_html=True,) -## set variables -MODEL_NAME = "gpt-3.5-turbo-16k" - ## set save dir USER_RESUME_SAVE_DIR = os.path.join(st.session_state["save_dir"], "2_generate_question_user_resume.pdf") ### 추가 @@ -191,9 +188,7 @@ st.session_state.logger.info("create prompt JD object") ### 모델 세팅 그대로 - llm = ChatOpenAI( - temperature=st.session_state.temperature, model_name=MODEL_NAME, openai_api_key=OPENAI_API_KEY - ) + llm = ChatOpenAI(temperature=st.session_state.temperature, model_name=MODEL_NAME) st.session_state.logger.info("create llm object") diff --git a/src/make_faiss_index.py b/src/make_faiss_index.py index 827d723..a5707ba 100644 --- a/src/make_faiss_index.py +++ b/src/make_faiss_index.py @@ -12,7 +12,7 @@ data = pd.read_csv('hellojobits_tag.csv') data = data.iloc[:,0].tolist() -model_name = "sentence-transformers/distiluse-base-multilingual-cased-v2" +model_name = "jhgan/ko-sroberta-multitask" model_kwargs = {'device': 'cuda'} encode_kwargs = {'normalize_embeddings': True} # set True to compute cosine similarity model_norm = HuggingFaceEmbeddings( diff --git a/src/semantic_search.py b/src/semantic_search.py index 3812a78..c3604cf 100644 --- a/src/semantic_search.py +++ b/src/semantic_search.py @@ -15,7 +15,7 @@ def faiss_inference(query): output으로는 (4 * 키워드 줄 개수 - 중복된 문장)개의 질문이 반환됩니다 ''' embeddings = HuggingFaceEmbeddings( - model_name = "sentence-transformers/distiluse-base-multilingual-cased-v2", + model_name = "BM-K/KoSimCSE-roberta-multitask", model_kwargs = {'device': 'cuda'} ) store_name="./FAISS_INDEX_TAG"