Update app.py
Browse files
app.py
CHANGED
|
@@ -37,15 +37,14 @@ class RequestBody(BaseModel):
|
|
| 37 |
# -------------------------------
|
| 38 |
SYSTEM_PROMPT = """You are an expert academic editor.
|
| 39 |
|
| 40 |
-
|
| 41 |
-
- Reads
|
| 42 |
- Has clear structure and good flow.
|
| 43 |
-
- Uses a formal
|
| 44 |
-
-
|
| 45 |
-
-
|
| 46 |
-
-
|
| 47 |
-
|
| 48 |
-
Output only the rewritten text. Do not include explanations or notes.
|
| 49 |
"""
|
| 50 |
|
| 51 |
|
|
@@ -65,11 +64,11 @@ async def humanize(body: RequestBody):
|
|
| 65 |
try:
|
| 66 |
output = llm(
|
| 67 |
prompt,
|
| 68 |
-
max_tokens=
|
| 69 |
-
temperature=0.55,
|
| 70 |
top_p=0.9,
|
| 71 |
repeat_penalty=1.05,
|
| 72 |
-
stop=["</s>", "[USER]", "[SYSTEM]"],
|
| 73 |
)
|
| 74 |
result = output["choices"][0]["text"].strip()
|
| 75 |
return {"result": result}
|
|
|
|
| 37 |
# -------------------------------
|
| 38 |
SYSTEM_PROMPT = """You are an expert academic editor.
|
| 39 |
|
| 40 |
+
Rewrite the user's text so that it:
|
| 41 |
+
- Reads naturally and human-like.
|
| 42 |
- Has clear structure and good flow.
|
| 43 |
+
- Uses a formal academic tone.
|
| 44 |
+
- Improves grammar, clarity, and coherence.
|
| 45 |
+
- DOES NOT add explanations, apologies, meta comments, or reasoning steps.
|
| 46 |
+
- DOES NOT mention rewriting, editing, IEEE, or instructions.
|
| 47 |
+
- Outputs ONLY the rewritten paragraph and nothing else.
|
|
|
|
| 48 |
"""
|
| 49 |
|
| 50 |
|
|
|
|
| 64 |
try:
|
| 65 |
output = llm(
|
| 66 |
prompt,
|
| 67 |
+
max_tokens=160,
|
| 68 |
+
temperature=0.55,
|
| 69 |
top_p=0.9,
|
| 70 |
repeat_penalty=1.05,
|
| 71 |
+
stop=["</s>", "[USER]", "[SYSTEM]", "[ASSISTANT]", "[/ASSISTANT]"],
|
| 72 |
)
|
| 73 |
result = output["choices"][0]["text"].strip()
|
| 74 |
return {"result": result}
|