Poc to use safetensors (#19175)
* Poc to use safetensors * Typo * Final version * Add tests * Save with the right name! * Update tests/test_modeling_common.py Co-authored-by: Julien Chaumond <julien@huggingface.co> * Support for sharded checkpoints * Test from Hub part 1 * Test from hub part 2 * Fix regular checkpoint sharding * Bump for fixes Co-authored-by: Julien Chaumond <julien@huggingface.co>
This commit is contained in:
@@ -60,6 +60,7 @@ from .utils import (
|
||||
is_pytesseract_available,
|
||||
is_pytorch_quantization_available,
|
||||
is_rjieba_available,
|
||||
is_safetensors_available,
|
||||
is_scatter_available,
|
||||
is_scipy_available,
|
||||
is_sentencepiece_available,
|
||||
@@ -264,6 +265,13 @@ def require_accelerate(test_case):
|
||||
return unittest.skipUnless(is_accelerate_available(), "test requires accelerate")(test_case)
|
||||
|
||||
|
||||
def require_safetensors(test_case):
|
||||
"""
|
||||
Decorator marking a test that requires safetensors. These tests are skipped when safetensors isn't installed.
|
||||
"""
|
||||
return unittest.skipUnless(is_safetensors_available(), "test requires safetensors")(test_case)
|
||||
|
||||
|
||||
def require_rjieba(test_case):
|
||||
"""
|
||||
Decorator marking a test that requires rjieba. These tests are skipped when rjieba isn't installed.
|
||||
|
||||
Reference in New Issue
Block a user