Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lightllm/server/build_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ def tokenizer_supports_force_thinking() -> bool:
logger.debug(f"chat_template: {tokenizer.chat_template}")
logger.info(f"tokenizer_supports_force_thinking : {ans}")
return ans
except:
except (AttributeError, TypeError):
pass

try:
ans = "thinking" in tokenizer.tokenizer.chat_template or "enable_thinking" in tokenizer.tokenizer.chat_template
logger.debug(f"tokenizer.tokenizer.chat_template: {tokenizer.tokenizer.chat_template}")
logger.info(f"tokenizer_supports_force_thinking : {ans}")
return ans
except:
except (AttributeError, TypeError):
pass

logger.info("tokenizer_supports_force_thinking : False")
Expand Down
2 changes: 1 addition & 1 deletion lightllm/server/core/objs/py_sampling_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _cfg(key, default):
cls._top_p = _cfg("top_p", 1.0)
cls._top_k = _cfg("top_k", -1)
cls._stop_sequences = generation_cfg.get("stop", None)
except:
except Exception:
pass

def verify(self):
Expand Down
2 changes: 1 addition & 1 deletion lightllm/server/core/objs/sampling_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def _cfg(key, default):
cls._temperature = _cfg("temperature", 1.0)
cls._top_p = _cfg("top_p", 1.0)
cls._top_k = _cfg("top_k", -1)
except:
except Exception:
pass

def verify(self):
Expand Down
4 changes: 2 additions & 2 deletions lightllm/server/embed_cache/afs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def save_tensor_afs(self, name: str, tensor: torch.Tensor) -> bool:
finally:
try:
tmp_path.unlink(missing_ok=True)
except:
except OSError:
pass

def load_tensor_afs(self, name: str) -> Optional[torch.Tensor]:
Expand Down Expand Up @@ -132,7 +132,7 @@ def insert(self, md5: str, tensor: torch.Tensor) -> bool:
ans = self.afs_utils.save_tensor_afs(md5, tensor)
self.redis_client.update(md5)
return ans
except:
except Exception:
return False

def load(self, md5: str) -> Optional[torch.Tensor]:
Expand Down
16 changes: 8 additions & 8 deletions lightllm/server/httpserver_for_pd_master/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async def update_req_status(self, upkv_status: PDUpKVStatus):
up_status_event = self.req_id_to_out_inf[group_request_id].up_status_event
up_status_event.upkv_status = upkv_status
up_status_event.set()
except:
except Exception:
pass
return

Expand Down Expand Up @@ -414,7 +414,7 @@ async def _generate_one_attempt(

try:
await self.abort(block_group_request_id, p_node=p_node, d_node=d_node)
except:
except Exception:
await self.abort(block_group_request_id)
raise e

Expand Down Expand Up @@ -724,25 +724,25 @@ async def abort(
del self.req_id_to_out_inf[group_request_id]
p_node = req_status.p_node
d_node = req_status.d_node
except:
except Exception:
pass

try:
await p_node.websocket.send_bytes(pickle.dumps((ObjType.ABORT, group_request_id)))
except:
except Exception:
pass

try:
await d_node.websocket.send_bytes(pickle.dumps((ObjType.ABORT, group_request_id)))
except:
except Exception:
pass

return

async def remove_req(self, group_request_id):
try:
del self.req_id_to_out_inf[group_request_id]
except:
except Exception:
pass

async def timer_log(self):
Expand Down Expand Up @@ -782,7 +782,7 @@ async def handle_loop(self):
async with req_status.lock:
req_status.out_token_info_list.append((sub_req_id, text, metadata, finish_status))
req_status.event.set()
except:
except Exception:
pass
elif obj[0] == ObjType.PD_UPLOAD_PREFILL_PROMPT_IDS:
_, group_req_id, prompt_ids = obj
Expand All @@ -791,7 +791,7 @@ async def handle_loop(self):
async with req_status.lock:
req_status.prefill_prompt_ids_event.prompt_ids = prompt_ids
req_status.prefill_prompt_ids_event.set()
except:
except Exception:
logger.error(
f"PD_UPLOAD_PREFILL_PROMPT_IDS fail find req status for group_req_id: {group_req_id}"
)
Expand Down
2 changes: 1 addition & 1 deletion lightllm/server/metrics/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def push_metrics(self):
if time_counter >= 60:
logger.info("push metrices success")
time_counter = 0
except:
except Exception:
pass
finally:
time.sleep(self.interval)
Expand Down
2 changes: 1 addition & 1 deletion lightllm/server/multi_level_kv_cache/shm_objs.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def _create_shm(name: str, byte_size: int, auto_cleanup: bool = False):
if auto_cleanup:
register_posix_shm_for_cleanup(name)
logger.info(f"create lock shm {name}")
except:
except Exception:
shm = shared_memory.SharedMemory(name=name, create=False, size=byte_size)
logger.info(f"link lock shm {name}")
return shm
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def accept_peer_task_loop(
for notify in _notify_list:
try:
notify_obj = pickle.loads(notify)
except:
except Exception:
notify_obj = None

if not isinstance(notify_obj, PDChunckedTransTask):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def is_trans_process_health(self):
return False
else:
return True
except:
except Exception:
return False

def killself(self):
Expand Down