WebashalarForML commited on
Commit
e68e1fe
·
verified ·
1 Parent(s): 8318d64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -47,7 +47,7 @@ TEMP_PATH = None
47
 
48
  #System prompt
49
  PROMPT_TEMPLATE = """
50
- You are working with a retrieval-augmented generation (RAG) setup. Your task is to generate a response based on the context provided and the question asked. Consider only the following context strictly, and use it to answer the question. Do not include any external information.
51
 
52
  Context:
53
  {context}
@@ -60,6 +60,7 @@ Question:
60
  Response:
61
  """
62
 
 
63
  # PROMPT_TEMPLATE = """
64
  # You are working with a retrieval-augmented generation (RAG) setup. Your task is to generate a response based on the provided context, table data, and the question asked. Consider only the given inputs strictly and use them to answer the question. Do not include any external information.
65
 
@@ -146,7 +147,7 @@ def chat():
146
 
147
  data= llm(prompt)
148
  #data = response.choices[0].message.content
149
-
150
  # filtering the uneccessary context.
151
  if re.search(r'\bmention\b|\bnot mention\b|\bnot mentioned\b|\bnot contain\b|\bnot include\b|\bnot provide\b|\bdoes not\b|\bnot explicitly\b|\bnot explicitly mentioned\b', data, re.IGNORECASE):
152
  data = "We do not have information related to your query on our end."
 
47
 
48
  #System prompt
49
  PROMPT_TEMPLATE = """
50
+ You are working with a retrieval-augmented generation (RAG) setup. Your task is to generate a response based on the context provided and the question asked. Consider only the following context strictly, and use it to answer the question. If the question cannot be answered using the context, respond with: "The information requested is not mentioned in the context."
51
 
52
  Context:
53
  {context}
 
60
  Response:
61
  """
62
 
63
+
64
  # PROMPT_TEMPLATE = """
65
  # You are working with a retrieval-augmented generation (RAG) setup. Your task is to generate a response based on the provided context, table data, and the question asked. Consider only the given inputs strictly and use them to answer the question. Do not include any external information.
66
 
 
147
 
148
  data= llm(prompt)
149
  #data = response.choices[0].message.content
150
+ print("LLM response------------------>",data)
151
  # filtering the uneccessary context.
152
  if re.search(r'\bmention\b|\bnot mention\b|\bnot mentioned\b|\bnot contain\b|\bnot include\b|\bnot provide\b|\bdoes not\b|\bnot explicitly\b|\bnot explicitly mentioned\b', data, re.IGNORECASE):
153
  data = "We do not have information related to your query on our end."