dungeon29 commited on
Commit
046f252
·
verified ·
1 Parent(s): bd84849

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -13
app.py CHANGED
@@ -393,21 +393,11 @@ def rag_predict_fn(text: str):
393
  end_time = time.time()
394
  elapsed_time = end_time - start_time
395
 
396
- # Parse response to extract Label and Explanation
397
- label = "ANALYSIS"
 
398
  explanation = response
399
 
400
- # Clean up response for parsing
401
- clean_response = response.strip()
402
-
403
- # Basic parsing logic for "LABEL: ... EXPLANATION: ..." format
404
- if "LABEL:" in clean_response:
405
- try:
406
- parts = clean_response.split("EXPLANATION:")
407
- label_part = parts[0].replace("LABEL:", "").strip().upper()
408
- if len(parts) > 1:
409
- explanation = parts[1].strip()
410
- else:
411
  # Simple parsing logic
412
  lines = response.split('\n')
413
  for line in lines:
 
393
  end_time = time.time()
394
  elapsed_time = end_time - start_time
395
 
396
+ # Parse LLM Response (New Format)
397
+ classification = "UNKNOWN"
398
+ confidence = "N/A"
399
  explanation = response
400
 
 
 
 
 
 
 
 
 
 
 
 
401
  # Simple parsing logic
402
  lines = response.split('\n')
403
  for line in lines: