style: fix linting and trailing whitespace
This commit is contained in:
parent
896e203574
commit
c806694379
1 changed files with 11 additions and 7 deletions
|
|
@ -525,7 +525,7 @@ class LightRAG:
|
||||||
_print_config = ",\n ".join([f"{k} = {v}" for k, v in global_config.items()])
|
_print_config = ",\n ".join([f"{k} = {v}" for k, v in global_config.items()])
|
||||||
logger.debug(f"LightRAG init with param:\n {_print_config}\n")
|
logger.debug(f"LightRAG init with param:\n {_print_config}\n")
|
||||||
|
|
||||||
# Init Embedding
|
# Init Embedding
|
||||||
# Step 1: Capture max_token_size and embedding_dim before applying decorator
|
# Step 1: Capture max_token_size and embedding_dim before applying decorator
|
||||||
embedding_max_token_size = None
|
embedding_max_token_size = None
|
||||||
if self.embedding_func and hasattr(self.embedding_func, "max_token_size"):
|
if self.embedding_func and hasattr(self.embedding_func, "max_token_size"):
|
||||||
|
|
@ -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):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue