LDJA commited on
Commit
b94b7ba
1 Parent(s): 4a06c56
app/app.py CHANGED
@@ -19,7 +19,7 @@ def prepare_data():
19
  st.title("Sortie de la commande Python")
20
 
21
  # Commande Python à exécuter
22
- command = "sudo python3 data/shakespeare_char/prepare.py"
23
 
24
  # Sorties de la commmande
25
  stdout, stderr = run_command(command)
 
19
  st.title("Sortie de la commande Python")
20
 
21
  # Commande Python à exécuter
22
+ command = "python3 data/shakespeare_char/prepare.py"
23
 
24
  # Sorties de la commmande
25
  stdout, stderr = run_command(command)
app/data/shakespeare_char/prepare.py CHANGED
@@ -46,10 +46,11 @@ print(f"train has {len(train_ids):,} tokens")
46
  print(f"val has {len(val_ids):,} tokens")
47
 
48
  # export to bin files
 
49
  train_ids = np.array(train_ids, dtype=np.uint16)
50
  val_ids = np.array(val_ids, dtype=np.uint16)
51
- train_ids.tofile(os.path.join(os.path.dirname(__file__), 'train.bin'))
52
- val_ids.tofile(os.path.join(os.path.dirname(__file__), 'val.bin'))
53
  # file_path_train = './train.bin'
54
  # file_path_val = './val.bin'
55
  # permissions = 0o755
 
46
  print(f"val has {len(val_ids):,} tokens")
47
 
48
  # export to bin files
49
+ permissions = 0o755
50
  train_ids = np.array(train_ids, dtype=np.uint16)
51
  val_ids = np.array(val_ids, dtype=np.uint16)
52
+ train_ids.tofile(os.path.join(os.chmod(os.path.dirname(__file__), 'train.bin'), permissions)
53
+ val_ids.tofile(os.path.join(os.chmod(os.path.dirname(__file__), 'val.bin'), permissions)
54
  # file_path_train = './train.bin'
55
  # file_path_val = './val.bin'
56
  # permissions = 0o755