NLong commited on
Commit
edee27e
Β·
verified Β·
1 Parent(s): 058eb47

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1365,7 +1365,7 @@ def analyze_news(news_text):
1365
  # Step 6: Format the final results
1366
  real_confidence = combined_confidence
1367
  fake_confidence = 1 - combined_confidence
1368
-
1369
  # Step 7: Check if result should be added to knowledge base (using only Gemini confidence for RAG)
1370
  gemini_real_confidence, gemini_fake_confidence = extract_gemini_percentage(gemini_analysis)
1371
  gemini_max_confidence = max(gemini_real_confidence, gemini_fake_confidence)
@@ -1393,7 +1393,7 @@ def analyze_news(news_text):
1393
  print(f"πŸ” DEBUG: gemini_max_confidence = {gemini_max_confidence}")
1394
  print(f"πŸ” DEBUG: RAG_CONFIDENCE_THRESHOLD = {RAG_CONFIDENCE_THRESHOLD}")
1395
  print(f"πŸ” DEBUG: Should save? {ENABLE_ENHANCED_RAG and gemini_max_confidence > RAG_CONFIDENCE_THRESHOLD}")
1396
- if ENABLE_ENHANCED_RAG and gemini_max_confidence > RAG_CONFIDENCE_THRESHOLD:
1397
  try:
1398
  from rag_news_manager import add_news_to_rag
1399
 
 
1365
  # Step 6: Format the final results
1366
  real_confidence = combined_confidence
1367
  fake_confidence = 1 - combined_confidence
1368
+ # Set to 0 to avoid errors
1369
  # Step 7: Check if result should be added to knowledge base (using only Gemini confidence for RAG)
1370
  gemini_real_confidence, gemini_fake_confidence = extract_gemini_percentage(gemini_analysis)
1371
  gemini_max_confidence = max(gemini_real_confidence, gemini_fake_confidence)
 
1393
  print(f"πŸ” DEBUG: gemini_max_confidence = {gemini_max_confidence}")
1394
  print(f"πŸ” DEBUG: RAG_CONFIDENCE_THRESHOLD = {RAG_CONFIDENCE_THRESHOLD}")
1395
  print(f"πŸ” DEBUG: Should save? {ENABLE_ENHANCED_RAG and gemini_max_confidence > RAG_CONFIDENCE_THRESHOLD}")
1396
+ if ENABLE_ENHANCED_RAG and gemini_max_confidence >= RAG_CONFIDENCE_THRESHOLD:
1397
  try:
1398
  from rag_news_manager import add_news_to_rag
1399