Delete full_models/rename.sh
Browse files- full_models/rename.sh +0 -30
full_models/rename.sh
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
#!/bin/bash
|
| 2 |
-
|
| 3 |
-
# Function to extract number from directory name
|
| 4 |
-
get_number() {
|
| 5 |
-
echo "$1" | grep -oE 'fineweb_subset_[0-9]+' | grep -oE '[0-9]+$'
|
| 6 |
-
}
|
| 7 |
-
|
| 8 |
-
# Process all matching directories
|
| 9 |
-
for dir in _*pretrain*_fineweb_subset_*/; do
|
| 10 |
-
# Skip if not a directory
|
| 11 |
-
[ -d "$dir" ] || continue
|
| 12 |
-
|
| 13 |
-
# Extract the number from directory name
|
| 14 |
-
num=$(get_number "$dir")
|
| 15 |
-
|
| 16 |
-
# Find state_step*.pt files in the directory
|
| 17 |
-
for file in "$dir"state_step*.pt; do
|
| 18 |
-
# Skip if file doesn't exist
|
| 19 |
-
[ -f "$file" ] || continue
|
| 20 |
-
|
| 21 |
-
# Define new filename
|
| 22 |
-
new_name="full_model_${num}.pt"
|
| 23 |
-
|
| 24 |
-
# Move and rename
|
| 25 |
-
echo "Moving $file -> $new_name"
|
| 26 |
-
mv "$file" "$new_name"
|
| 27 |
-
done
|
| 28 |
-
done
|
| 29 |
-
|
| 30 |
-
echo "Done!"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|