Sadjad Alikhani commited on
Commit
0c7e0b8
·
verified ·
1 Parent(s): 3b88dd2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -453,8 +453,8 @@ def process_hdf5_file(uploaded_file, percentage):
453
 
454
  # Step 5: Load the HDF5 file and extract the channels and labels
455
  with h5py.File(uploaded_file.name, 'r') as f:
456
- channels = torch.tensor(f['channels']).float() #astype(np.float32) # Assuming 'channels' dataset in the HDF5 file
457
- labels = torch.tensor(f['labels']).long() # Assuming 'labels' dataset in the HDF5 file
458
  print(f"Loaded dataset with {channels.shape[0]} samples.")
459
 
460
  # Step 7: Tokenize the data using the tokenizer from input_preprocess
 
453
 
454
  # Step 5: Load the HDF5 file and extract the channels and labels
455
  with h5py.File(uploaded_file.name, 'r') as f:
456
+ channels = np.array(f['channels']).astype(np.complex64) #astype(np.float32) # Assuming 'channels' dataset in the HDF5 file
457
+ labels = np.array(f['labels']).astype(np.int32) # Assuming 'labels' dataset in the HDF5 file
458
  print(f"Loaded dataset with {channels.shape[0]} samples.")
459
 
460
  # Step 7: Tokenize the data using the tokenizer from input_preprocess