Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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", "
|
237 |
template="""
|
238 |
-
Give me an introduction to the following
|
|
|
|
|
|
|
239 |
|
|
|
240 |
query: {query}
|
241 |
-
|
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
|
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
|
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)
|
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):
|