arka7 commited on
Commit
934f544
·
verified ·
1 Parent(s): 0ce4543

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -28
app.py CHANGED
@@ -401,9 +401,19 @@ Researchers at the University of California, Davis have used artificial intellig
401
  By altering key amino acids, the team reactivated weakened receptors, restoring the plants’ ability to detect pathogens. This innovation could provide broad-spectrum disease resistance in major crops, including protection against Ralstonia solanacearum, the bacterium that causes bacterial wilt. The researchers now plan to extend this strategy to other plants using machine learning.
402
 
403
  #CCA_RnD #TuesdayTrivia #ArtificialIntelligence #ProteinEngineering #PlantImmunity #AgriTech #BacterialWilt #GreenTech"""
 
 
 
 
 
 
 
 
 
404
  }
405
  ]
406
 
 
407
  return json.dumps(examples, indent=2)
408
 
409
 
@@ -548,16 +558,16 @@ Output Format:
548
  return state
549
 
550
  def run_curator(state: EnhancedAgentState, progress_callback=None) -> EnhancedAgentState:
551
- """Curator Agent - Uses mistral-large-latest"""
552
  try:
553
  print("\n" + "="*70)
554
  print("🤖 CURATOR AGENT")
555
- print(f"📊 Model: mistral-large-latest")
556
  print(f"🎯 Purpose: Rank candidates and select best story")
557
  print("="*70)
558
 
559
  if progress_callback:
560
- progress_callback("🎯 Curator (mistral-large) selecting story...")
561
 
562
  candidates = state.get("candidates", [])
563
  candidates_text = candidates[0].get("raw", "") if candidates else ""
@@ -578,7 +588,7 @@ Output: RANKED CANDIDATES, then SELECTED STORY with title uniqueness check.""")
578
 
579
  user_msg = HumanMessage(content=f"Rank and select the best story. CHECK TITLE SIMILARITY FIRST:\n{candidates_text}")
580
 
581
- curator_llm = llm_large.bind_tools([check_topic_similarity, get_all_previous_posts])
582
  response = curator_llm.invoke([system_msg, user_msg])
583
  conversation = [system_msg, user_msg, response]
584
 
@@ -635,9 +645,7 @@ Paragraph 2
635
  #TuesdayTrivia #RnDCell #CCA #Topic1 #Topic2
636
 
637
  TITLE REQUIREMENTS:
638
- - Must be unique and compelling
639
- - Use check_topic_similarity to verify uniqueness
640
- - If title is too similar (>80% overlap), create a completely different title approach
641
 
642
  CONTENT:
643
  - 140-180 words, technical but accessible
@@ -696,10 +704,8 @@ def run_critic(state: EnhancedAgentState, progress_callback=None) -> EnhancedAge
696
 
697
  EVALUATION CRITERIA:
698
 
699
- 1. TITLE UNIQUENESS (2 points):
700
- - Use check_topic_similarity to verify title uniqueness
701
- - Title must have <90% word overlap with existing posts
702
- - But title also must have some similarity to example posts , use get_example_posts_for_critic for this
703
 
704
  2. FORMAT (2 points):
705
  - Title on first line
@@ -1203,23 +1209,6 @@ with gr.Blocks(css=css, title="Tuesday Trivia Agent", theme=gr.themes.Soft()) as
1203
 
1204
  manual_sync_btn = gr.Button("🔄 Manual Sync to HF", size="sm")
1205
 
1206
- with gr.Accordion("📊 Model Information", open=False):
1207
- gr.Markdown("""
1208
- **Discovery Agent:** mistral-small-latest
1209
- → Fast, efficient for search and filtering
1210
-
1211
- **Curator Agent:** mistral-large-latest
1212
- → Best reasoning for ranking and selection
1213
-
1214
- **Writer Agent:** mistral-medium-latest
1215
- → Balanced creativity and quality
1216
-
1217
- **Critic Agent:** mistral-large-latest
1218
- → Detailed analysis and evaluation
1219
-
1220
- All agents check **title similarity** to avoid duplicates.
1221
- """)
1222
-
1223
  gr.Markdown("---")
1224
  gr.Markdown("""
1225
  ### ℹ️ Instructions
 
401
  By altering key amino acids, the team reactivated weakened receptors, restoring the plants’ ability to detect pathogens. This innovation could provide broad-spectrum disease resistance in major crops, including protection against Ralstonia solanacearum, the bacterium that causes bacterial wilt. The researchers now plan to extend this strategy to other plants using machine learning.
402
 
403
  #CCA_RnD #TuesdayTrivia #ArtificialIntelligence #ProteinEngineering #PlantImmunity #AgriTech #BacterialWilt #GreenTech"""
404
+ },
405
+ {
406
+ "title": "Researchers Have Developed a Flexible, Low-Cost Robotic Skin That Allows Machines to Sense Touch Like Humans",
407
+ "content": """Researchers Have Developed a Flexible, Low-Cost Robotic Skin That Allows Machines to Sense Touch Like Humans
408
+
409
+ Scientists at the University of Cambridge have created a revolutionary skin-like material that brings us a step closer to giving robots a true sense of touch. This soft, flexible “robotic skin” is made from a smart gel that covers the entire surface of a robot, acting as a single, large sensor. Unlike older technologies that required hundreds of tiny sensors, this material can detect pressure, heat, and even pain—all at the same time and across multiple areas.
410
+ This breakthrough means robots can now respond more naturally and sensitively to their environment. They can handle delicate objects with care or react safely to human contact. This is especially important in settings like hospitals, elderly care, or even homes, where robots may assist people directly. Just like human skin helps us feel and respond to the world around us, this innovation allows machines to become more aware, making them more helpful, empathetic, and human-friendly than ever before.
411
+
412
+ #TuesdayTrivia #Robotic_Skin #Cambridge_University #Smart_skin_Revolution #RnD_Cell #CCA"""
413
  }
414
  ]
415
 
416
+
417
  return json.dumps(examples, indent=2)
418
 
419
 
 
558
  return state
559
 
560
  def run_curator(state: EnhancedAgentState, progress_callback=None) -> EnhancedAgentState:
561
+ """Curator Agent - Uses mistral-small-latest"""
562
  try:
563
  print("\n" + "="*70)
564
  print("🤖 CURATOR AGENT")
565
+ print(f"📊 Model: mistral-small-latest")
566
  print(f"🎯 Purpose: Rank candidates and select best story")
567
  print("="*70)
568
 
569
  if progress_callback:
570
+ progress_callback("🎯 Curator (mistral-small) selecting story...")
571
 
572
  candidates = state.get("candidates", [])
573
  candidates_text = candidates[0].get("raw", "") if candidates else ""
 
588
 
589
  user_msg = HumanMessage(content=f"Rank and select the best story. CHECK TITLE SIMILARITY FIRST:\n{candidates_text}")
590
 
591
+ curator_llm = llm_small.bind_tools([check_topic_similarity, get_all_previous_posts])
592
  response = curator_llm.invoke([system_msg, user_msg])
593
  conversation = [system_msg, user_msg, response]
594
 
 
645
  #TuesdayTrivia #RnDCell #CCA #Topic1 #Topic2
646
 
647
  TITLE REQUIREMENTS:
648
+ - Use get_example_posts_for_writer to make similar titles
 
 
649
 
650
  CONTENT:
651
  - 140-180 words, technical but accessible
 
704
 
705
  EVALUATION CRITERIA:
706
 
707
+ 1. TITLE (2 points):
708
+ - Title should have some similarity to example posts , use get_example_posts_for_critic for this
 
 
709
 
710
  2. FORMAT (2 points):
711
  - Title on first line
 
1209
 
1210
  manual_sync_btn = gr.Button("🔄 Manual Sync to HF", size="sm")
1211
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1212
  gr.Markdown("---")
1213
  gr.Markdown("""
1214
  ### ℹ️ Instructions