hemantn commited on
Commit
9c57bc9
Β·
1 Parent(s): cec6abd

Add error handling and verification for encodings.py copy operation

Browse files
Files changed (1) hide show
  1. adapter.py +10 -2
adapter.py CHANGED
@@ -99,8 +99,16 @@ if os.path.exists(encodings_src):
99
  os.makedirs('ablang2/pretrained_utils', exist_ok=True)
100
  dst = 'ablang2/pretrained_utils/encodings.py'
101
  print(f"πŸ“‹ Copying {encodings_src} to {dst}")
102
- shutil.copy2(encodings_src, dst)
103
- print("βœ… Copied ablang_encodings.py as encodings.py for compatibility")
 
 
 
 
 
 
 
 
104
  else:
105
  print("❌ ablang_encodings.py not found!")
106
 
 
99
  os.makedirs('ablang2/pretrained_utils', exist_ok=True)
100
  dst = 'ablang2/pretrained_utils/encodings.py'
101
  print(f"πŸ“‹ Copying {encodings_src} to {dst}")
102
+ try:
103
+ shutil.copy2(encodings_src, dst)
104
+ print("βœ… Copied ablang_encodings.py as encodings.py for compatibility")
105
+ # Verify the copy worked
106
+ if os.path.exists(dst):
107
+ print(f"βœ… Verified {dst} exists after copy")
108
+ else:
109
+ print(f"❌ {dst} does not exist after copy!")
110
+ except Exception as e:
111
+ print(f"❌ Error copying file: {e}")
112
  else:
113
  print("❌ ablang_encodings.py not found!")
114