Raghavan1988
commited on
Commit
•
56d3408
1
Parent(s):
9c9e34b
updated prompt to generate summary and takeaway
Browse files
app.py
CHANGED
@@ -55,10 +55,29 @@ def generate(
|
|
55 |
seed = seed + 1
|
56 |
|
57 |
arxiv_key = prompt.strip().split(".")
|
58 |
-
if len(arxiv_key)
|
59 |
output = "Please enter a valid arXiv ID."
|
60 |
return output
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
formatted_prompt = format_prompt(prompt, history, system_prompt)
|
63 |
|
64 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
|
|
|
55 |
seed = seed + 1
|
56 |
|
57 |
arxiv_key = prompt.strip().split(".")
|
58 |
+
if len(arxiv_key) <= 2:
|
59 |
output = "Please enter a valid arXiv ID."
|
60 |
return output
|
61 |
|
62 |
+
|
63 |
+
arxiv_id = prompt
|
64 |
+
docs = ArxivLoader(query="1605.08386", load_max_docs=2).load()
|
65 |
+
doc = docs[0]
|
66 |
+
|
67 |
+
title = doc["Title"]
|
68 |
+
abstract = doc["Summary"]
|
69 |
+
authors = doc["Authors"]
|
70 |
+
published = doc["Published"]
|
71 |
+
|
72 |
+
prompt = "You are a RESEARCH Assistant, who is tasked with Summarizing a scholarly research article paper. You are given the following information:\n"
|
73 |
+
prompt += f"Title: {title}\n"
|
74 |
+
prompt += f"Authors: {authors}\n"
|
75 |
+
prompt += f"Published: {published}\n"
|
76 |
+
prompt += f"Abstract: {abstract}\n"
|
77 |
+
prompt += f"Your task is to summarize the paper in 3-4 bullet points, generating key takeaways \n"
|
78 |
+
prompt += f"Generate a FUTURE IDEA for the paper, that can be used to extend the paper. \n"
|
79 |
+
|
80 |
+
|
81 |
formatted_prompt = format_prompt(prompt, history, system_prompt)
|
82 |
|
83 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
|