Skip to content

Commit 52e4f23

Browse files
committed
Fix EdgeCraftRAG ruff lint errors
1 parent 5ed4b2f commit 52e4f23

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

EdgeCraftRAG/edgecraftrag/api/v1/pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ async def update_pipeline_handler(pl, req):
233233
else:
234234
raise Exception("Inference Type Not Supported")
235235
flag = pl.check_top_k(ctx.get_knowledge_mgr().get_all_knowledge_bases())
236-
if flag == True:
236+
if flag:
237237
await save_pipeline_configurations("update", pl)
238238
if pl.status.active != req.active:
239239
ctx.get_pipeline_mgr().activate_pipeline(

EdgeCraftRAG/edgecraftrag/controllers/modelmgr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def load_model(model_para: ModelIn):
8686
enable_genai = os.getenv("ENABLE_GENAI", "").lower() == "true"
8787
match model_para.model_type:
8888
case ModelType.EMBEDDING:
89-
if model_para.device == "NPU" or enable_genai == True:
89+
if model_para.device == "NPU" or enable_genai:
9090
model = OpenVINOGenAIEmbeddingModel(
9191
model_id=model_para.model_id,
9292
model_path=model_para.model_path,
@@ -106,7 +106,7 @@ def load_model(model_para: ModelIn):
106106
api_base=model_para.api_base,
107107
)
108108
case ModelType.RERANKER:
109-
if enable_genai == True:
109+
if enable_genai:
110110
model = OpenVINOGenAIRerankModel(
111111
model_id=model_para.model_id,
112112
model_path=model_para.model_path,

EdgeCraftRAG/edgecraftrag/controllers/pipelinemgr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def remove_pipeline_by_name_or_id(self, name: str):
4747
if self._prev_active_pipeline_name and pl.name == self._prev_active_pipeline_name:
4848
raise Exception("Pipeline is currently cached, unable to remove...")
4949
pl.retrievers = None
50-
if pl.postprocessor != None:
50+
if pl.postprocessor is not None:
5151
for post in pl.postprocessor:
5252
try:
5353
post.model._model.clear_requests()

0 commit comments

Comments
 (0)