Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -33,18 +33,16 @@ def extract_text_from_pdf(file):
|
|
| 33 |
return None, f"PDF reading error: {str(e)}"
|
| 34 |
|
| 35 |
def generate_output(text, summary_lang, style, char_limit, quiz_check):
|
| 36 |
-
quiz_prompt = QUIZ_INSTRUCTIONS.get(summary_lang, QUIZ_INSTRUCTIONS["English"]) if quiz_check else ""
|
| 37 |
-
|
| 38 |
prompt = f"""
|
| 39 |
You are a helpful assistant.
|
| 40 |
|
| 41 |
Summarize the following text in {summary_lang} using a {style} style.
|
| 42 |
Keep it within approximately {char_limit} characters.
|
| 43 |
Then provide 5 keywords.
|
| 44 |
-
|
| 45 |
{quiz_prompt}
|
| 46 |
|
| 47 |
-
|
| 48 |
TEXT:
|
| 49 |
{text[:3000]}
|
| 50 |
"""
|
|
|
|
| 33 |
return None, f"PDF reading error: {str(e)}"
|
| 34 |
|
| 35 |
def generate_output(text, summary_lang, style, char_limit, quiz_check):
|
| 36 |
+
quiz_prompt = QUIZ_INSTRUCTIONS.get(summary_lang, QUIZ_INSTRUCTIONS["English"]) if quiz_check else ""
|
| 37 |
+
|
| 38 |
prompt = f"""
|
| 39 |
You are a helpful assistant.
|
| 40 |
|
| 41 |
Summarize the following text in {summary_lang} using a {style} style.
|
| 42 |
Keep it within approximately {char_limit} characters.
|
| 43 |
Then provide 5 keywords.
|
|
|
|
| 44 |
{quiz_prompt}
|
| 45 |
|
|
|
|
| 46 |
TEXT:
|
| 47 |
{text[:3000]}
|
| 48 |
"""
|