KvrParaskevi commited on
Commit
9f71064
1 Parent(s): dc4a656

Update chatbot.py

Browse files
Files changed (1) hide show
  1. chatbot.py +3 -3
chatbot.py CHANGED
@@ -26,7 +26,7 @@ booking process.
26
  Current conversation:
27
  {history}
28
 
29
- Human: {{{input}}}
30
  AI: [/INST]"""
31
 
32
  #@st.cache_resource
@@ -68,7 +68,7 @@ def demo_miny_memory():
68
 
69
  def demo_chain(input_text,history):
70
  #PROMPT = ChatPromptTemplate.from_template(template)
71
- PROMPT = ChatPromptTemplate.from_messages(history)
72
  conversation = ConversationChain(
73
  prompt=PROMPT,
74
  llm=llm,
@@ -78,4 +78,4 @@ def demo_chain(input_text,history):
78
  )
79
 
80
  chat_reply = conversation.invoke(input=input_text, max_new_tokens = 100)
81
- return chat_reply['response']
 
26
  Current conversation:
27
  {history}
28
 
29
+ Human: {input}
30
  AI: [/INST]"""
31
 
32
  #@st.cache_resource
 
68
 
69
  def demo_chain(input_text,history):
70
  #PROMPT = ChatPromptTemplate.from_template(template)
71
+ PROMPT = PromptTemplate(template=template, input_variables=["history", "input"])
72
  conversation = ConversationChain(
73
  prompt=PROMPT,
74
  llm=llm,
 
78
  )
79
 
80
  chat_reply = conversation.invoke(input=input_text, max_new_tokens = 100)
81
+ return chat_reply.split('AI:')[-1]