Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,6 +99,9 @@ def rewrite_level(text, target_level):
|
|
| 99 |
|
| 100 |
prompt = f"""
|
| 101 |
Rewrite the following passage so it fits about {target_flesch} Flesch Reading Ease Score
|
|
|
|
|
|
|
|
|
|
| 102 |
- Preserve the original meaning faithfully.
|
| 103 |
- Do not add new information or remove essential information.
|
| 104 |
- Output only the rewritten passage. Do not include explanations.
|
|
@@ -109,7 +112,7 @@ Rewrite the following passage so it fits about {target_flesch} Flesch Reading Ea
|
|
| 109 |
model="google/gemma-3-27b-it:free",
|
| 110 |
messages=[{"role": "user", "content": prompt}],
|
| 111 |
temperature=0.4,
|
| 112 |
-
max_tokens=
|
| 113 |
)
|
| 114 |
return resp.choices[0].message.content.strip()
|
| 115 |
|
|
|
|
| 99 |
|
| 100 |
prompt = f"""
|
| 101 |
Rewrite the following passage so it fits about {target_flesch} Flesch Reading Ease Score
|
| 102 |
+
- Extract only the portions of the text that should be read as the main body,
|
| 103 |
+
excluding the title, author name, source information, chapter number, annotations, and footers.
|
| 104 |
+
- When outputting, make sure sections divided by chapters, etc., are clearly distinguishable by leaving a blank line between them.
|
| 105 |
- Preserve the original meaning faithfully.
|
| 106 |
- Do not add new information or remove essential information.
|
| 107 |
- Output only the rewritten passage. Do not include explanations.
|
|
|
|
| 112 |
model="google/gemma-3-27b-it:free",
|
| 113 |
messages=[{"role": "user", "content": prompt}],
|
| 114 |
temperature=0.4,
|
| 115 |
+
max_tokens=5000
|
| 116 |
)
|
| 117 |
return resp.choices[0].message.content.strip()
|
| 118 |
|