mathslearn commited on
Commit
e04a518
·
verified ·
1 Parent(s): 9a3f86b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -17,9 +17,9 @@ import gradio as gr
17
 
18
  llm = ChatOpenAI(model_name="gpt-3.5-turbo", openai_api_key="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")
19
 
20
- if 'buffer_memory' not in st.session_state:
21
- st.session_state.buffer_memory = ConversationBufferWindowMemory(k=8)
22
- #st.session_state.buffer_memory = ConversationBufferWindowMemory(k=3)
23
 
24
  conversation = ConversationChain(
25
  llm=llm,
@@ -34,7 +34,7 @@ It is important to note that a chatbot is not a substitute for medical advice \
34
  from a qualified healthcare professional. \
35
  You respond in a short, very friendly style. \
36
  For each text, mark NER tags. \
37
- Tag categories: location, product \
38
  Text: I want to visit a clinic in [Ang Mo Kio](location). \
39
  If a user says he/she wants to visit a traditional chinese medicine (TCM) clinic, \
40
  ask for which location he/she wants to visit. \
@@ -78,6 +78,7 @@ Marine Parade
78
  Queenstown
79
  Toa Payoh
80
  For each text, mark NER tags. \
 
81
  Text: I want to buy/get [Po Chai Pills](product). \
82
  If a user wants to buy/get a product, suggest that \
83
  he/she can consider buying/getting from https://www.amazon.sg/s?k=product+name \
 
17
 
18
  llm = ChatOpenAI(model_name="gpt-3.5-turbo", openai_api_key="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")
19
 
20
+ if 'buffer_memory' not in gr.session_state:
21
+ gr.session_state.buffer_memory = ConversationBufferWindowMemory(k=8)
22
+ #gr.session_state.buffer_memory = ConversationBufferWindowMemory(k=3)
23
 
24
  conversation = ConversationChain(
25
  llm=llm,
 
34
  from a qualified healthcare professional. \
35
  You respond in a short, very friendly style. \
36
  For each text, mark NER tags. \
37
+ Tag categories: location, product. \
38
  Text: I want to visit a clinic in [Ang Mo Kio](location). \
39
  If a user says he/she wants to visit a traditional chinese medicine (TCM) clinic, \
40
  ask for which location he/she wants to visit. \
 
78
  Queenstown
79
  Toa Payoh
80
  For each text, mark NER tags. \
81
+ Tag categories: location, product. \
82
  Text: I want to buy/get [Po Chai Pills](product). \
83
  If a user wants to buy/get a product, suggest that \
84
  he/she can consider buying/getting from https://www.amazon.sg/s?k=product+name \