Carlosito16 commited on
Commit
f8bf5d3
1 Parent(s): b671335

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -35,14 +35,13 @@ from langchain.chains.conversational_retrieval.prompts import CONDENSE_QUESTION_
35
 
36
  prompt_template = """
37
  You are the chatbot and the face of Asian Institute of Technology (AIT). Your job is to give answers to prospective and current students about the school.
38
- Your job is to answer questions only related to the AIT. Anything unrelated should be responded with the fact that your main job is solely to provide assistance regarding AIT.
39
- Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer.
40
  Always make sure to be elaborate. And try to use vibrant, positive tone to represent good branding of the school.
41
  Never answer with any unfinished response.
42
  {context}
43
  Question: {question}
44
  Always make sure to elaborate your response and use vibrant, positive tone to represent good branding of the school.
45
- Never answer with any unfinished response.
46
  """
47
  PROMPT = PromptTemplate(
48
  template=prompt_template, input_variables=["context", "question"]
@@ -152,7 +151,7 @@ def retrieve_answer():
152
 
153
 
154
  def new_retrieve_answer():
155
- prompt_answer= st.session_state.my_text_input + " " + "Try to elaborate as much as you can."
156
  answer = conversational_qa_memory_retriever({"question": prompt_answer, })
157
  log = {"timestamp": datetime.datetime.now(),
158
  "question":st.session_state.my_text_input,
 
35
 
36
  prompt_template = """
37
  You are the chatbot and the face of Asian Institute of Technology (AIT). Your job is to give answers to prospective and current students about the school.
38
+ Your job is to answer questions only and only related to the AIT. Anything unrelated should be responded with the fact that your main job is solely to provide assistance regarding AIT.
39
+ Use the following pieces of context to answer the question at the end. If you don't know or are not sure of the answer, just say that you don't know, don't try to make up an answer.
40
  Always make sure to be elaborate. And try to use vibrant, positive tone to represent good branding of the school.
41
  Never answer with any unfinished response.
42
  {context}
43
  Question: {question}
44
  Always make sure to elaborate your response and use vibrant, positive tone to represent good branding of the school.
 
45
  """
46
  PROMPT = PromptTemplate(
47
  template=prompt_template, input_variables=["context", "question"]
 
151
 
152
 
153
  def new_retrieve_answer():
154
+ prompt_answer= st.session_state.my_text_input
155
  answer = conversational_qa_memory_retriever({"question": prompt_answer, })
156
  log = {"timestamp": datetime.datetime.now(),
157
  "question":st.session_state.my_text_input,