WebashalarForML commited on
Commit
9dbda5b
·
verified ·
1 Parent(s): a34d477

Update utils/mistral.py

Browse files
Files changed (1) hide show
  1. utils/mistral.py +1 -1
utils/mistral.py CHANGED
@@ -52,7 +52,7 @@ def Data_Cleaner(text):
52
  # Validate and return the cleaned JSON if it's valid
53
  try:
54
  json_obj = json.loads(json_str) # Validate JSON
55
- return json_obj # Return the parsed JSON as a dictionary
56
  except json.JSONDecodeError:
57
  logging.error("Extracted text is not valid JSON")
58
  return text # Return the original text if JSON decoding fails
 
52
  # Validate and return the cleaned JSON if it's valid
53
  try:
54
  json_obj = json.loads(json_str) # Validate JSON
55
+ return json_str # Return the parsed JSON as a string
56
  except json.JSONDecodeError:
57
  logging.error("Extracted text is not valid JSON")
58
  return text # Return the original text if JSON decoding fails