Add debugging to see what files are copied to pretrained_utils
Browse files- adapter.py +9 -1
adapter.py
CHANGED
|
@@ -90,11 +90,19 @@ for file in UTILITY_FILES:
|
|
| 90 |
os.makedirs(os.path.dirname(dst), exist_ok=True)
|
| 91 |
shutil.copy2(src, dst)
|
| 92 |
|
| 93 |
-
# Also copy
|
| 94 |
if os.path.exists('ablang_encodings.py') and not os.path.exists('ablang2/pretrained_utils/encodings.py'):
|
| 95 |
# Ensure the destination directory exists
|
| 96 |
os.makedirs('ablang2/pretrained_utils', exist_ok=True)
|
| 97 |
shutil.copy2('ablang_encodings.py', 'ablang2/pretrained_utils/encodings.py')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
# Now import using the original structure
|
| 100 |
from ablang2.pretrained_utils.restoration import AbRestore
|
|
|
|
| 90 |
os.makedirs(os.path.dirname(dst), exist_ok=True)
|
| 91 |
shutil.copy2(src, dst)
|
| 92 |
|
| 93 |
+
# Also copy ablang_encodings.py as encodings.py (original name for compatibility)
|
| 94 |
if os.path.exists('ablang_encodings.py') and not os.path.exists('ablang2/pretrained_utils/encodings.py'):
|
| 95 |
# Ensure the destination directory exists
|
| 96 |
os.makedirs('ablang2/pretrained_utils', exist_ok=True)
|
| 97 |
shutil.copy2('ablang_encodings.py', 'ablang2/pretrained_utils/encodings.py')
|
| 98 |
+
print("✅ Copied ablang_encodings.py as encodings.py for compatibility")
|
| 99 |
+
|
| 100 |
+
# Debug: Check what files are actually in the pretrained_utils directory
|
| 101 |
+
pretrained_utils_dir = os.path.join(current_dir, 'ablang2', 'pretrained_utils')
|
| 102 |
+
if os.path.exists(pretrained_utils_dir):
|
| 103 |
+
print(f"📁 Files in {pretrained_utils_dir}:")
|
| 104 |
+
for f in os.listdir(pretrained_utils_dir):
|
| 105 |
+
print(f" {f}")
|
| 106 |
|
| 107 |
# Now import using the original structure
|
| 108 |
from ablang2.pretrained_utils.restoration import AbRestore
|