lainlives commited on
Commit
db35eaa
·
verified ·
1 Parent(s): 9c4f9b1

Add files using upload-large-folder tool

Browse files
.gitattributes CHANGED
@@ -135,3 +135,13 @@ f4f3cecfdf5572c32a21c524530831adadf43f95faa71187d22128ae988e8d29 filter=lfs diff
135
  32faaa459dfda883ce6fd01b28377715f5e1dba3ea6a6788753a48ccb96257f3 filter=lfs diff=lfs merge=lfs -text
136
  575e29e481c1ee2d601d16aaa0ae4150c28656701a811f79d65248f90877de42 filter=lfs diff=lfs merge=lfs -text
137
  mel_band_roformer_vocals_fv6_gabox.ckpt filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
135
  32faaa459dfda883ce6fd01b28377715f5e1dba3ea6a6788753a48ccb96257f3 filter=lfs diff=lfs merge=lfs -text
136
  575e29e481c1ee2d601d16aaa0ae4150c28656701a811f79d65248f90877de42 filter=lfs diff=lfs merge=lfs -text
137
  mel_band_roformer_vocals_fv6_gabox.ckpt filter=lfs diff=lfs merge=lfs -text
138
+ 00fd6b804eeacc2160fc26c22c26c975a3a1d435b11af9511a1f2a8729f0efd6 filter=lfs diff=lfs merge=lfs -text
139
+ c5bee397ef0af7f4979763967d3fd8be3430aa7abfe4195cabf9fa6be151702e filter=lfs diff=lfs merge=lfs -text
140
+ mel_band_roformer_vocals_v2_gabox.ckpt filter=lfs diff=lfs merge=lfs -text
141
+ b9a32663d871c00c642e870ef2cb5510a22688b900bec20768cfdbd039693097 filter=lfs diff=lfs merge=lfs -text
142
+ db2f9bf5dbc22140e19a1962be2bd3acd8da1f6cb2c52a52c81914a4df85670b filter=lfs diff=lfs merge=lfs -text
143
+ b15e2df393105c4a0d92b96c4b787e4f2e15836603f1a20b00aac910c70f7447 filter=lfs diff=lfs merge=lfs -text
144
+ mel_band_roformer_vocals_gabox.ckpt filter=lfs diff=lfs merge=lfs -text
145
+ 2e6f915a4a46bb2faf3f9334307b5291c4792712e268f6e814365fda7d224ad7 filter=lfs diff=lfs merge=lfs -text
146
+ 58501836606d77f3ec904de11ef1fe0c9f09022fa0b128668bfc12e5fac69490 filter=lfs diff=lfs merge=lfs -text
147
+ mel_band_roformer_vocal_fullness_aname.ckpt filter=lfs diff=lfs merge=lfs -text
00fd6b804eeacc2160fc26c22c26c975a3a1d435b11af9511a1f2a8729f0efd6 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec34be50327aeaf1a996c27977f5c30d1ac80c0076d69683d3e5184c31ea29d3
3
+ size 913090472
2e6f915a4a46bb2faf3f9334307b5291c4792712e268f6e814365fda7d224ad7 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0ca36af5d1314be46b56c8a53b6be02f98511fa5d7e3e196fd895755e65be3c
3
+ size 913026650
58501836606d77f3ec904de11ef1fe0c9f09022fa0b128668bfc12e5fac69490 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b4f12d81fd7fb02f38609216d59f0e42b3dca655fd90ca275ab5321b3e4d9aa
3
+ size 913026650
assets/__pycache__/model_tools.cpython-313.pyc CHANGED
Binary files a/assets/__pycache__/model_tools.cpython-313.pyc and b/assets/__pycache__/model_tools.cpython-313.pyc differ
 
assets/delete_duplicate_models.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import hashlib
3
+ from collections import defaultdict
4
+ import model_tools as mt
5
+
6
+ if __name__ == "__main__":
7
+ print(f"Scanning directory: {os.getcwd()}")
8
+ mt.find_and_remove_duplicates()
assets/model_tools.py CHANGED
@@ -5,6 +5,60 @@ import sys
5
  import subprocess
6
  import requests
7
  from huggingface_hub import HfApi, snapshot_download
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
 
10
  def download_files_from_txt(filename, local_dir):
 
5
  import subprocess
6
  import requests
7
  from huggingface_hub import HfApi, snapshot_download
8
+ import hashlib
9
+ from collections import defaultdict
10
+
11
+
12
+ def calculate_file_hash(filepath, block_size=65536):
13
+ """Calculates the SHA256 hash of a file's content."""
14
+ sha256 = hashlib.sha256()
15
+ try:
16
+ with open(filepath, "rb") as f:
17
+ while chunk := f.read(block_size):
18
+ sha256.update(chunk)
19
+ except FileNotFoundError:
20
+ return None # Handle cases where a file might be deleted during the scan
21
+
22
+ return sha256.hexdigest()
23
+
24
+
25
+ def find_and_remove_duplicates(directory="."):
26
+ """Finds duplicate files in the given directory and removes the one with the longer filename."""
27
+ hashes_to_files = defaultdict(list)
28
+ files_to_hash = {}
29
+
30
+ # Step 1: Hash all files in the directory
31
+ for filename in os.listdir(directory):
32
+ filepath = os.path.join(directory, filename)
33
+ if os.path.isfile(filepath):
34
+ file_hash = calculate_file_hash(filepath)
35
+ if file_hash:
36
+ hashes_to_files[file_hash].append(filepath)
37
+ files_to_hash[filepath] = file_hash
38
+
39
+ # Step 2: Identify duplicate groups (more than one file per hash)
40
+ duplicates = {h: files for h, files in hashes_to_files.items() if len(files) > 1}
41
+
42
+ if not duplicates:
43
+ print("No duplicate files found.")
44
+ return
45
+
46
+ # Step 3: Iterate over duplicates, compare filename length, and delete the longer one
47
+ for file_hash, file_list in duplicates.items():
48
+ # Sort files by filename length (ascending). The one to keep is the first item.
49
+ # If lengths are equal, an arbitrary one is kept.
50
+ files_sorted_by_length = sorted(file_list, key=len)
51
+ file_to_keep = files_sorted_by_length[0]
52
+ files_to_delete = files_sorted_by_length[1:]
53
+
54
+ print(f"\nDuplicate group (Hash: {file_hash[:10]}...):")
55
+ print(f" Keeping: {file_to_keep}")
56
+ for file_to_delete in files_to_delete:
57
+ try:
58
+ os.remove(file_to_delete)
59
+ print(f" Deleted: {file_to_delete} (longer filename)")
60
+ except OSError as e:
61
+ print(f" Error deleting {file_to_delete}: {e}")
62
 
63
 
64
  def download_files_from_txt(filename, local_dir):
b15e2df393105c4a0d92b96c4b787e4f2e15836603f1a20b00aac910c70f7447 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d7d97418012e1d241853260d82330869c3e945ffdef9d7841fd90f5b24f20ff
3
+ size 913026650
b9a32663d871c00c642e870ef2cb5510a22688b900bec20768cfdbd039693097 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1de20d459332fe8869aeb01327a31df0032262706e1365114e852dc271779813
3
+ size 913096801
c5bee397ef0af7f4979763967d3fd8be3430aa7abfe4195cabf9fa6be151702e ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:303fc631e7aa587e9dc1e6ac4bb3667c6ba53aacb6b6a90abcfcf57935b92bd8
3
+ size 913026650
db2f9bf5dbc22140e19a1962be2bd3acd8da1f6cb2c52a52c81914a4df85670b ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25920c876e601d4ccbf1684b19ecdac4b9fcfcc7f48d2c095d81040ec3fecbea
3
+ size 913026650