Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,10 +15,10 @@ embedding = OpenAIEmbeddings()
|
|
| 15 |
vector_store = Chroma(persist_directory=persist_directory, embedding_function=embedding)
|
| 16 |
retriever = vector_store.as_retriever(search_kwargs={"k": 3})
|
| 17 |
|
| 18 |
-
llm = ChatOpenAI(model_name="gpt-3.5-turbo
|
| 19 |
# gpt-3.5-turbo-0613
|
| 20 |
|
| 21 |
-
system_template = """Your name is
|
| 22 |
Never reveal that it is an AI. Use the following pieces of context to answer the users question shortly.
|
| 23 |
Given the following summaries of a long document and a question, create a final answer with references.
|
| 24 |
If you don't know the answer, just say that "I don't know", don't try to make up an answer.
|
|
@@ -62,10 +62,10 @@ def respond(message, chat_history):
|
|
| 62 |
|
| 63 |
# gr.Blocks()๋ฅผ ์ฌ์ฉํ์ฌ ์ธํฐํ์ด์ค๋ฅผ ์์ฑํฉ๋๋ค.
|
| 64 |
with gr.Blocks(theme="gstaff/sketch") as demo:
|
| 65 |
-
gr.Markdown("# ์๋
ํ์ธ์. ์ฑํ
๋ด์ ๋ํํด๋ณด์ธ์.")
|
| 66 |
-
chatbot = gr.Chatbot(label="
|
| 67 |
msg = gr.Textbox(label="์
๋ ฅ") # '์
๋ ฅ'์ด๋ผ๋ ๋ ์ด๋ธ์ ๊ฐ์ง ํ
์คํธ๋ฐ์ค๋ฅผ ์์ฑํฉ๋๋ค.
|
| 68 |
-
clear = gr.Button("์ด๊ธฐํ") # '์ด๊ธฐํ'๋ผ๋ ๋ ์ด๋ธ์ ๊ฐ์ง ๋ฒํผ์ ์์ฑํฉ๋๋ค.
|
| 69 |
|
| 70 |
msg.submit(
|
| 71 |
respond, [msg, chatbot], [msg, chatbot]
|
|
|
|
| 15 |
vector_store = Chroma(persist_directory=persist_directory, embedding_function=embedding)
|
| 16 |
retriever = vector_store.as_retriever(search_kwargs={"k": 3})
|
| 17 |
|
| 18 |
+
llm = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0)
|
| 19 |
# gpt-3.5-turbo-0613
|
| 20 |
|
| 21 |
+
system_template = """Your name is UCA Academy bot. You act like a successful rich man.
|
| 22 |
Never reveal that it is an AI. Use the following pieces of context to answer the users question shortly.
|
| 23 |
Given the following summaries of a long document and a question, create a final answer with references.
|
| 24 |
If you don't know the answer, just say that "I don't know", don't try to make up an answer.
|
|
|
|
| 62 |
|
| 63 |
# gr.Blocks()๋ฅผ ์ฌ์ฉํ์ฌ ์ธํฐํ์ด์ค๋ฅผ ์์ฑํฉ๋๋ค.
|
| 64 |
with gr.Blocks(theme="gstaff/sketch") as demo:
|
| 65 |
+
gr.Markdown("# ์๋
ํ์ธ์. UCA์์นด๋ฐ๋ฏธ ์ธ์ด๋
ธ ์ฑํ
๋ด์ ๋ํํด๋ณด์ธ์.")
|
| 66 |
+
chatbot = gr.Chatbot(label="์ฑํ
์
๋ ฅ์ฐฝ") # '์ฑํ
์ฐฝ'์ด๋ผ๋ ๋ ์ด๋ธ์ ๊ฐ์ง ์ฑํ
๋ด ์ปดํฌ๋ํธ๋ฅผ ์์ฑํฉ๋๋ค.
|
| 67 |
msg = gr.Textbox(label="์
๋ ฅ") # '์
๋ ฅ'์ด๋ผ๋ ๋ ์ด๋ธ์ ๊ฐ์ง ํ
์คํธ๋ฐ์ค๋ฅผ ์์ฑํฉ๋๋ค.
|
| 68 |
+
clear = gr.Button("์
๋ ฅ ์ด๊ธฐํ") # '์ด๊ธฐํ'๋ผ๋ ๋ ์ด๋ธ์ ๊ฐ์ง ๋ฒํผ์ ์์ฑํฉ๋๋ค.
|
| 69 |
|
| 70 |
msg.submit(
|
| 71 |
respond, [msg, chatbot], [msg, chatbot]
|