refactor: Remove commented out code in app.py
Browse files
app.py
CHANGED
@@ -28,11 +28,11 @@ retriever = load_retrievers(embeddings)
|
|
28 |
|
29 |
# ์ฌ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ธ ๋ชฉ๋ก (key: ๋ชจ๋ธ ์๋ณ์, value: ์ฌ์ฉ์์๊ฒ ํ์ํ ๋ ์ด๋ธ)
|
30 |
AVAILABLE_MODELS = {
|
31 |
-
"gpt_3_5_turbo": "GPT-3.5 Turbo",
|
32 |
"gpt_4o": "GPT-4o",
|
33 |
"claude_3_5_sonnet": "Claude 3.5 Sonnet",
|
34 |
"gemini_1_5_flash": "Gemini 1.5 Flash",
|
35 |
-
"llama3_70b": "Llama3 70b",
|
36 |
}
|
37 |
|
38 |
|
@@ -41,7 +41,7 @@ def create_rag_chain(chat_history: List[Tuple[str, str]], model: str):
|
|
41 |
for human, ai in chat_history:
|
42 |
langchain_messages.append(HumanMessage(content=human))
|
43 |
langchain_messages.append(AIMessage(content=ai))
|
44 |
-
|
45 |
llm = get_llm(streaming=STREAMING).with_config(configurable={"llm": model})
|
46 |
prompt = get_prompt().partial(history=langchain_messages)
|
47 |
|
@@ -107,8 +107,8 @@ with gr.Blocks() as demo:
|
|
107 |
chatbot = gr.Chatbot(height="50vh")
|
108 |
msg = gr.Textbox(label="๋ฉ์์ง ์
๋ ฅ")
|
109 |
with gr.Row():
|
110 |
-
send_btn = gr.Button("์ ์ก")
|
111 |
clear = gr.Button("๋ํ ๋ด์ฉ ์ง์ฐ๊ธฐ")
|
|
|
112 |
|
113 |
def user(user_message, history):
|
114 |
return "", history + [[user_message, None]]
|
@@ -130,4 +130,4 @@ with gr.Blocks() as demo:
|
|
130 |
clear.click(lambda: None, None, chatbot, queue=False)
|
131 |
|
132 |
if __name__ == "__main__":
|
133 |
-
demo.launch()
|
|
|
28 |
|
29 |
# ์ฌ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ธ ๋ชฉ๋ก (key: ๋ชจ๋ธ ์๋ณ์, value: ์ฌ์ฉ์์๊ฒ ํ์ํ ๋ ์ด๋ธ)
|
30 |
AVAILABLE_MODELS = {
|
31 |
+
# "gpt_3_5_turbo": "GPT-3.5 Turbo",
|
32 |
"gpt_4o": "GPT-4o",
|
33 |
"claude_3_5_sonnet": "Claude 3.5 Sonnet",
|
34 |
"gemini_1_5_flash": "Gemini 1.5 Flash",
|
35 |
+
# "llama3_70b": "Llama3 70b",
|
36 |
}
|
37 |
|
38 |
|
|
|
41 |
for human, ai in chat_history:
|
42 |
langchain_messages.append(HumanMessage(content=human))
|
43 |
langchain_messages.append(AIMessage(content=ai))
|
44 |
+
|
45 |
llm = get_llm(streaming=STREAMING).with_config(configurable={"llm": model})
|
46 |
prompt = get_prompt().partial(history=langchain_messages)
|
47 |
|
|
|
107 |
chatbot = gr.Chatbot(height="50vh")
|
108 |
msg = gr.Textbox(label="๋ฉ์์ง ์
๋ ฅ")
|
109 |
with gr.Row():
|
|
|
110 |
clear = gr.Button("๋ํ ๋ด์ฉ ์ง์ฐ๊ธฐ")
|
111 |
+
send_btn = gr.Button("์ ์ก")
|
112 |
|
113 |
def user(user_message, history):
|
114 |
return "", history + [[user_message, None]]
|
|
|
130 |
clear.click(lambda: None, None, chatbot, queue=False)
|
131 |
|
132 |
if __name__ == "__main__":
|
133 |
+
demo.launch()
|