style: fix linting and trailing whitespace

This commit is contained in:
captainmirk 2025-12-03 11:36:06 +00:00
parent 896e203574
commit c806694379

View file

@ -691,13 +691,17 @@ class LightRAG:
f"Please clear the '{self.working_dir}' directory or switch back to the original model." f"Please clear the '{self.working_dir}' directory or switch back to the original model."
) )
except json.JSONDecodeError: except json.JSONDecodeError:
logger.warning(f"Could not parse {meta_file}. Skipping dimension check.") logger.warning(
f"Could not parse {meta_file}. Skipping dimension check."
)
else: else:
# First run: Save the metadata # First run: Save the metadata
meta_data = { meta_data = {
"embedding_dim": self.embedding_dim, "embedding_dim": self.embedding_dim,
"embedding_model_func": self.embedding_func.__class__.__name__ if self.embedding_func else "unknown", "embedding_model_func": self.embedding_func.__class__.__name__
"created_at": str(os.path.abspath(self.working_dir)) if self.embedding_func
else "unknown",
"created_at": str(os.path.abspath(self.working_dir)),
} }
# Ensure directory exists # Ensure directory exists
if not os.path.exists(self.working_dir): if not os.path.exists(self.working_dir):