rohan112 commited on
Commit
464cc76
·
verified ·
1 Parent(s): 9f62bdd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -31,12 +31,10 @@ model = ChatTogether(
31
  temperature=0.0,
32
  max_tokens=500,)
33
 
34
- template = """<s>[INST] answer from context only as if person is responding. answer in medium length.
35
- answer for asked question only, if he greets greet back.
36
- {context}
37
- Question: {question} [/INST]
38
- """
39
- prompt = ChatPromptTemplate.from_template(template)
40
 
41
  chain = (
42
  {"context": retriever, "question": RunnablePassthrough()}
@@ -46,7 +44,7 @@ chain = (
46
  )
47
 
48
 
49
- st.title("Chat with me chat")
50
 
51
  # Initialize chat history
52
  if "messages" not in st.session_state:
 
31
  temperature=0.0,
32
  max_tokens=500,)
33
 
34
+ prompt = ChatPromptTemplate([
35
+ ("system", "You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question. If you don't know the answer, just say that you don't know. answer as if person is responding. and if user greets then greet back"),
36
+ ("user", "context : {context}, Question: {question}")
37
+ ])
 
 
38
 
39
  chain = (
40
  {"context": retriever, "question": RunnablePassthrough()}
 
44
  )
45
 
46
 
47
+ st.title("Chat with me")
48
 
49
  # Initialize chat history
50
  if "messages" not in st.session_state: