gnumanth commited on
Commit
ce549a4
·
verified ·
1 Parent(s): 4a5c91c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -26
app.py CHANGED
@@ -84,32 +84,9 @@ def save_uploaded_file(uploaded_file):
84
  async def summarize_text(text):
85
  """Summarize the input text using Gemini AI"""
86
  try:
87
- prompt = f"""You are tasked with summarizing a document into a maximum of 10 bullet points. Here is the document to be summarized:
88
-
89
-
90
- {{text}}
91
-
92
-
93
- Please follow these instructions to create an effective summary:
94
-
95
- 1. Carefully read and analyze the entire document.
96
- 2. Identify the main ideas, key points, and essential information.
97
- 3. Prioritize the most important concepts and details.
98
- 4. Condense the information into clear, concise bullet points.
99
- 5. Ensure that each bullet point captures a distinct and significant idea from the document.
100
- 6. Use your own words to summarize, avoiding direct quotes unless absolutely necessary.
101
- 7. Aim for clarity and brevity in each bullet point.
102
- 8. Include no more than 10 bullet points in total.
103
- 9. If the document is short or simple, you may use fewer than 10 bullet points.
104
- 10. Arrange the bullet points in a logical order that reflects the structure or flow of the original document.
105
-
106
- Guidelines for creating effective bullet points:
107
- - Start each bullet point with a dash (-)
108
- - Keep each bullet point to one or two sentences at most
109
- - Use parallel structure for consistency
110
- - Focus on conveying the essential information without unnecessary details
111
-
112
- Present your summary within <summary> tags. Begin each bullet point on a new line."""
113
 
114
  # Use the synchronous version since async version isn't working as expected
115
  response = model.generate_content(prompt)
 
84
  async def summarize_text(text):
85
  """Summarize the input text using Gemini AI"""
86
  try:
87
+ prompt = f"""Please provide a concise summary of the following text. Focus on the main points and key takeaways:
88
+ {text}
89
+ Summary:"""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
  # Use the synchronous version since async version isn't working as expected
92
  response = model.generate_content(prompt)