BramLeo commited on
Commit
bccaf5e
·
verified ·
1 Parent(s): 9cfd8ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -56,9 +56,13 @@ def save_to_huggingface():
56
  src = "bahandokumen/data.csv"
57
  dst = "/home/user/app/bahandokumen/data.csv" # Jalur sesuai dengan HF Spaces
58
 
 
59
  if os.path.exists(src):
60
- shutil.copy(src, dst)
61
- print(f"✅ File {src} berhasil disalin ke {dst}")
 
 
 
62
  else:
63
  print("❌ File tidak ditemukan, pastikan berhasil diunduh.")
64
 
 
56
  src = "bahandokumen/data.csv"
57
  dst = "/home/user/app/bahandokumen/data.csv" # Jalur sesuai dengan HF Spaces
58
 
59
+ # Pastikan file ada sebelum menyalin
60
  if os.path.exists(src):
61
+ if os.path.abspath(src) != os.path.abspath(dst): # Cek apakah lokasi berbeda
62
+ shutil.copy(src, dst)
63
+ print(f"✅ File {src} berhasil disalin ke {dst}")
64
+ else:
65
+ print("⚠️ File sudah berada di lokasi yang sama, tidak perlu disalin.")
66
  else:
67
  print("❌ File tidak ditemukan, pastikan berhasil diunduh.")
68