Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -418,29 +418,29 @@ if uploaded_file and st.button("π§ Analyze and Suggest Improvements"):
|
|
| 418 |
if not paper_text or len(paper_text.strip()) < 100:
|
| 419 |
st.warning("β οΈ The uploaded paper seems empty or too short to analyze.")
|
| 420 |
else:
|
| 421 |
-
|
| 422 |
{"role": "system", "content": "You are an expert academic advisor."},
|
| 423 |
{"role": "user", "content": f"""I have written the following research paper. Please analyze it and provide detailed suggestions on:
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
\"\"\"{paper_text}\"\"\""""}
|
| 431 |
-
]
|
| 432 |
|
|
|
|
|
|
|
| 433 |
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
|
| 441 |
except Exception as e:
|
| 442 |
st.error(f"β Error while analyzing paper: {e}")
|
| 443 |
|
|
|
|
| 444 |
# --- Full Chat History Viewer ---
|
| 445 |
st.divider()
|
| 446 |
with st.expander("π View Full Chat History", expanded=False):
|
|
|
|
| 418 |
if not paper_text or len(paper_text.strip()) < 100:
|
| 419 |
st.warning("β οΈ The uploaded paper seems empty or too short to analyze.")
|
| 420 |
else:
|
| 421 |
+
feedback_prompt = [
|
| 422 |
{"role": "system", "content": "You are an expert academic advisor."},
|
| 423 |
{"role": "user", "content": f"""I have written the following research paper. Please analyze it and provide detailed suggestions on:
|
| 424 |
+
- Areas where the paper is weak or unclear
|
| 425 |
+
- How to improve the novelty or originality
|
| 426 |
+
- Structural improvements or better ways to present arguments
|
| 427 |
+
|
| 428 |
+
Be honest and constructive. Here's the full text:
|
|
|
|
|
|
|
|
|
|
| 429 |
|
| 430 |
+
\"\"\"{paper_text}\"\"\""""}
|
| 431 |
+
]
|
| 432 |
|
| 433 |
+
st.status("π Analyzing your paper...")
|
| 434 |
+
improvement_output = ""
|
| 435 |
+
feedback_box = st.empty()
|
| 436 |
+
for chunk in call_llm(feedback_prompt, max_tokens=2500):
|
| 437 |
+
improvement_output += chunk
|
| 438 |
+
feedback_box.markdown(improvement_output, unsafe_allow_html=True)
|
| 439 |
|
| 440 |
except Exception as e:
|
| 441 |
st.error(f"β Error while analyzing paper: {e}")
|
| 442 |
|
| 443 |
+
|
| 444 |
# --- Full Chat History Viewer ---
|
| 445 |
st.divider()
|
| 446 |
with st.expander("π View Full Chat History", expanded=False):
|