Ani14 commited on
Commit
881216e
Β·
verified Β·
1 Parent(s): 575ef18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -15
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
- 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
 
434
- with st.status("πŸ”Ž Analyzing your paper..."):
435
- improvement_output = ""
436
- feedback_box = st.empty()
437
- for chunk in call_llm(feedback_prompt, max_tokens=2500):
438
- improvement_output += chunk
439
- feedback_box.markdown(improvement_output, unsafe_allow_html=True)
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):