GuXiaopeng commited on
Commit
780955e
·
verified ·
1 Parent(s): c4d7e57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -222,17 +222,17 @@ topic = st.text_input(ui["topic_label"], value="Generative Artificial Intelligen
222
  keywords = st.text_input(ui["keywords_label"], value="Ubiquitous computing; Context awareness; Deep learning; Personalized educational; Educational technologies; HCI; Recommendation system; LLMs; Generative AI; ChatGPT; Prompting engineering; Few-shot prompting", disabled=st.session_state.is_running)
223
  words = st.number_input(ui["words_label"], min_value=12000, max_value=25000, value=20000, step=1000, disabled=st.session_state.is_running)
224
 
225
- tab_wizard, tab_clone = st.tabs(["✨ 智能向导模式 (Smart Wizard)", "🧬 靶向克隆模式 (Clone Mode)"])
226
 
227
  with tab_wizard:
228
- st.markdown("### 🛠️ 人在环路:研究资料配置")
229
- prompt_style_ui = st.radio("1. 请选择期望的写作规范与提示词引擎:", options=["实证研究 (AMJ Style)", "自适应 (Adaptive Style)"], index=0, disabled=st.session_state.is_running)
230
  uploaded_papers_wiz = st.file_uploader("2. 上传参考论文 (可选,支持 PDF/DOCX,建议1-20篇)", type=["pdf", "doc", "docx"], accept_multiple_files=True, disabled=st.session_state.is_running)
231
  uploaded_data_wiz = st.file_uploader("3. 上传科研数据 (可选,支持 CSV/Excel,用于防幻觉)", type=["csv", "xlsx", "xls"], disabled=st.session_state.is_running)
232
 
233
  if st.button("🚀 启动智能向导生成", disabled=st.session_state.is_running, key="btn_wiz"):
234
  if not global_lock.acquire(blocking=False):
235
- st.warning("⏳ 有小伙伴正在创作,您在15-20 分钟后就能正常使用啦")
236
  else:
237
  global_lock.release()
238
  st.session_state.run_mode = "wizard"
@@ -240,7 +240,7 @@ with tab_wizard:
240
  st.rerun()
241
 
242
  with tab_clone:
243
- st.markdown("### 🧬 高级克隆:框架与风格复刻")
244
  context_differences = st.text_area("1. 研究背景与核心差异(Context & Differences)(必填,建议 1-2000 字)", placeholder="简述您的新研究与参考论文在数据、案例或背景上的核心区别...", max_chars=2000, disabled=st.session_state.is_running)
245
 
246
  if "extracted_sections" not in st.session_state:
@@ -269,7 +269,7 @@ with tab_clone:
269
  elif not uploaded_reference_clone:
270
  st.error("🚨 启动克隆模式必须上传范例论文!")
271
  elif not global_lock.acquire(blocking=False):
272
- st.warning("⏳ 有小伙伴正在创作,您在15-20 分钟后就能正常使用啦")
273
  else:
274
  global_lock.release()
275
  st.session_state.run_mode = "clone"
@@ -310,7 +310,7 @@ if st.session_state.start_pipeline or st.session_state.resume_pipeline:
310
  st.rerun()
311
 
312
  if not global_lock.acquire(blocking=False):
313
- st.warning("⏳ 有小伙伴正在创作,您在15-20 分钟后就能正常使用啦")
314
  st.session_state.start_pipeline = False
315
  st.session_state.resume_pipeline = False
316
  st.stop()
@@ -411,10 +411,10 @@ if st.session_state.start_pipeline or st.session_state.resume_pipeline:
411
  if st.session_state.run_mode == "wizard":
412
  if "AMJ" in prompt_style_ui:
413
  APP_CONFIG.update(AMJ_PROMPTS)
414
- st.success("🎯 用户显式指定:启用 AMJ 引擎。")
415
  else:
416
  APP_CONFIG.update(GENERIC_PROMPTS)
417
- st.info("ℹ️ 用户显式指定:启用通用学术引擎。")
418
 
419
  state["prompt_config"] = AMJ_PROMPTS if ("AMJ" in prompt_style_ui) else GENERIC_PROMPTS
420
 
 
222
  keywords = st.text_input(ui["keywords_label"], value="Ubiquitous computing; Context awareness; Deep learning; Personalized educational; Educational technologies; HCI; Recommendation system; LLMs; Generative AI; ChatGPT; Prompting engineering; Few-shot prompting", disabled=st.session_state.is_running)
223
  words = st.number_input(ui["words_label"], min_value=12000, max_value=25000, value=20000, step=1000, disabled=st.session_state.is_running)
224
 
225
+ tab_wizard, tab_clone = st.tabs(["✨ 实证研究(Empirical Study)", "🧬 范文复刻(Sample Imitate)"])
226
 
227
  with tab_wizard:
228
+ st.markdown("### 🛠️ 实证资料配置")
229
+ prompt_style_ui = st.radio("1. 请选择期望的写作规范与提示词引擎:", options=["AMJ Style", "Adaptive Style"], index=0, disabled=st.session_state.is_running)
230
  uploaded_papers_wiz = st.file_uploader("2. 上传参考论文 (可选,支持 PDF/DOCX,建议1-20篇)", type=["pdf", "doc", "docx"], accept_multiple_files=True, disabled=st.session_state.is_running)
231
  uploaded_data_wiz = st.file_uploader("3. 上传科研数据 (可选,支持 CSV/Excel,用于防幻觉)", type=["csv", "xlsx", "xls"], disabled=st.session_state.is_running)
232
 
233
  if st.button("🚀 启动智能向导生成", disabled=st.session_state.is_running, key="btn_wiz"):
234
  if not global_lock.acquire(blocking=False):
235
+ st.warning("⏳ 有小伙伴在写作,预计15-25 分钟后可用。")
236
  else:
237
  global_lock.release()
238
  st.session_state.run_mode = "wizard"
 
240
  st.rerun()
241
 
242
  with tab_clone:
243
+ st.markdown("### 🧬 框架与风格复刻")
244
  context_differences = st.text_area("1. 研究背景与核心差异(Context & Differences)(必填,建议 1-2000 字)", placeholder="简述您的新研究与参考论文在数据、案例或背景上的核心区别...", max_chars=2000, disabled=st.session_state.is_running)
245
 
246
  if "extracted_sections" not in st.session_state:
 
269
  elif not uploaded_reference_clone:
270
  st.error("🚨 启动克隆模式必须上传范例论文!")
271
  elif not global_lock.acquire(blocking=False):
272
+ st.warning("⏳ 有小伙伴在写作,预计15-25 分钟后可用。")
273
  else:
274
  global_lock.release()
275
  st.session_state.run_mode = "clone"
 
310
  st.rerun()
311
 
312
  if not global_lock.acquire(blocking=False):
313
+ st.warning("⏳ 有小伙伴在写作,预计15-25 分钟后可用。")
314
  st.session_state.start_pipeline = False
315
  st.session_state.resume_pipeline = False
316
  st.stop()
 
411
  if st.session_state.run_mode == "wizard":
412
  if "AMJ" in prompt_style_ui:
413
  APP_CONFIG.update(AMJ_PROMPTS)
414
+ st.success("🎯 用户显式指定:启用AMJ引擎。")
415
  else:
416
  APP_CONFIG.update(GENERIC_PROMPTS)
417
+ st.info("ℹ️ 用户显式指定:启用Adaptive引擎。")
418
 
419
  state["prompt_config"] = AMJ_PROMPTS if ("AMJ" in prompt_style_ui) else GENERIC_PROMPTS
420