Merge pull request #188 from haosenwang1018/fix/bare-excepts

fix: use specific exceptions instead of bare except
This commit is contained in:
xliucs
2026-03-03 11:49:00 +08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -156,7 +156,7 @@ def scan_lora_checkpoints(root_dir="lora", with_info=False):
with open(lora_config_file, "r", encoding="utf-8") as f:
lora_info = json.load(f)
base_model = lora_info.get("base_model", "Unknown")
except:
except (json.JSONDecodeError, OSError):
pass
checkpoints.append((rel_path, base_model))
else:
+1 -1
View File
@@ -222,7 +222,7 @@ class VoxCPMModel(nn.Module):
raise ValueError("VoxCPMModel can only be optimized on CUDA device")
try:
import triton
except:
except ImportError:
raise ValueError("triton is not installed")
self.base_lm.forward_step = torch.compile(self.base_lm.forward_step, mode="reduce-overhead", fullgraph=True)
self.residual_lm.forward_step = torch.compile(self.residual_lm.forward_step, mode="reduce-overhead", fullgraph=True)