MCPcopy Index your code
hub / github.com/microsoft/BitNet / cleanup_model

Method cleanup_model

utils/test_perplexity.py:314–324  ·  view source on GitHub ↗

Delete model file if it was created during this session.

(self, model_path)

Source from the content-addressed store, hash-verified

312 return None
313
314 def cleanup_model(self, model_path):
315 """Delete model file if it was created during this session."""
316 if model_path in self.created_models:
317 try:
318 model_path.unlink()
319 print(f"🗑️ Deleted: {model_path.name}")
320 self.created_models.remove(model_path)
321 except Exception as e:
322 print(f"⚠️ Failed to delete {model_path.name}: {e}")
323 else:
324 print(f"ℹ️ Keeping existing file: {model_path.name}")
325
326 def run_all_tests(self, threads=16, ctx_size=512):
327 """Run perplexity tests on all datasets."""

Callers 1

run_all_testsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected