Rams901 commited on
Commit
d2c5780
1 Parent(s): 62d92d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -233,27 +233,29 @@ def qa_intro(query, cynthesis, tier_1,):
233
  session_prompt = """ A bot that is open to discussions about different cultural, philosophical and political exchanges. You will use do different analysis to the articles provided to me. Stay truthful and if you weren't provided any resources give your oppinion only."""
234
 
235
  prompt = PromptTemplate(
236
- input_variables=["query", "cynthesis", "articles"],
237
  template="""
238
- Give me an introduction to the following consensus without repeating how it starts. Consider what you will write an abstract. And after finishing the introduction, pick one quote from the sources given below.
 
 
 
239
 
 
240
  query: {query}
241
- Here's the consensus: {cynthesis}
242
-
243
  We have the opportunity to give an introduction to this synthesis without repeating information found.
244
- Pick an opening quote from the sources given below and mention the reference\n
245
  ---------\n
246
  {articles}
247
  ---------\n
248
 
249
- Don't forget that your job is to only provide an introduction, abstract part that introduces the synthesis without repeating it and then pick one general quote from the sources given and put it's reference.""",
250
  )
251
 
252
-
253
  # llm = BardLLM()
254
  chain = LLMChain(llm=llm_4, prompt = prompt)
255
 
256
- intro = chain.run(query=query, articles="\n".join(tier_1), cynthesis = cynthesis)
257
  return intro.strip()
258
 
259
  def qa_faqs(query):
 
233
  session_prompt = """ A bot that is open to discussions about different cultural, philosophical and political exchanges. You will use do different analysis to the articles provided to me. Stay truthful and if you weren't provided any resources give your oppinion only."""
234
 
235
  prompt = PromptTemplate(
236
+ input_variables=["query", "articles"],
237
  template="""
238
+ Give me an introduction to the following topic. Consider this an abstract. And after finishing the introduction, pick one quote from the sources given below.
239
+ this is the desired structure:
240
+ Introduction: Introduction
241
+ Quote: "quote". [1] (Reference)
242
 
243
+ Follow the structure given.
244
  query: {query}
245
+
 
246
  We have the opportunity to give an introduction to this synthesis without repeating information found.
247
+ Pick an opening quote from the sources given below\n
248
  ---------\n
249
  {articles}
250
  ---------\n
251
 
252
+ Don't forget that your job is to only provide an introduction, abstract part that introduces the synthesis and then pick one general quote from the sources given. Maintain the desired structure.""",
253
  )
254
 
 
255
  # llm = BardLLM()
256
  chain = LLMChain(llm=llm_4, prompt = prompt)
257
 
258
+ intro = chain.run(query=query, articles="\n".join(tier_1))
259
  return intro.strip()
260
 
261
  def qa_faqs(query):