Download Tuning/Filter3.py from AbrFerdowsi/Training-Code-Checkpoints: direct link, hf CLI and curl.
- Browser
- Download file 628 Bytes
-
https://huggingface.co/AbrFerdowsi/Training-Code-Checkpoints/resolve/main/Tuning/Filter3.py
- Command line
-
hf download hf://AbrFerdowsi/Training-Code-Checkpoints/Tuning/Filter3.py
-
curl -L -o Filter3.py https://huggingface.co/AbrFerdowsi/Training-Code-Checkpoints/resolve/main/Tuning/Filter3.py
628 Bytes
| from datasets import load_from_disk | |
| TEST_PATH = "/home/ubuntu/Complete-HF-Dataset-4/test" | |
| test_dataset = load_from_disk(TEST_PATH) | |
| eval_batch_size = 4 | |
| broken_step = 5020 | |
| center_index = broken_step * eval_batch_size | |
| start_remove = center_index - 100 | |
| end_remove = center_index + 100 | |
| print("Removing samples from:", start_remove, "to", end_remove) | |
| keep_indices = list(range(0, start_remove)) + list(range(end_remove, len(test_dataset))) | |
| clean_test = test_dataset.select(keep_indices) | |
| print("Old size:", len(test_dataset)) | |
| print("New size:", len(clean_test)) | |
| clean_test.save_to_disk("/home/ubuntu/Clean-HF-Dataset-4/test") | |