tigerteam commited on
Commit
5e2c691
ยท
1 Parent(s): 981c862

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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-0613", temperature=0)
19
  # gpt-3.5-turbo-0613
20
 
21
- system_template = """Your name is Sayno. 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,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]