Spaces:
Running
Running
Sadjad Alikhani
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -446,7 +446,7 @@ def process_hdf5_file(uploaded_file, percentage):
|
|
446 |
|
447 |
# Step 5: Load the HDF5 file and extract the channels and labels
|
448 |
with h5py.File(uploaded_file.name, 'r') as f:
|
449 |
-
channels = np.array(f['channels']) # Assuming 'channels' dataset in the HDF5 file
|
450 |
labels = np.array(f['labels']) # Assuming 'labels' dataset in the HDF5 file
|
451 |
print(f"Loaded dataset with {channels.shape[0]} samples.")
|
452 |
|
@@ -455,7 +455,7 @@ def process_hdf5_file(uploaded_file, percentage):
|
|
455 |
#print(preprocessed_chs[0][0][1])
|
456 |
|
457 |
# Step 7: Perform inference using the functions from inference.py
|
458 |
-
output_emb = inference.lwm_inference(preprocessed_chs
|
459 |
output_raw = inference.create_raw_dataset(preprocessed_chs, device)
|
460 |
|
461 |
print(f"Output Embeddings Shape: {output_emb.shape}")
|
|
|
446 |
|
447 |
# Step 5: Load the HDF5 file and extract the channels and labels
|
448 |
with h5py.File(uploaded_file.name, 'r') as f:
|
449 |
+
channels = np.array(f['channels']).float() # Assuming 'channels' dataset in the HDF5 file
|
450 |
labels = np.array(f['labels']) # Assuming 'labels' dataset in the HDF5 file
|
451 |
print(f"Loaded dataset with {channels.shape[0]} samples.")
|
452 |
|
|
|
455 |
#print(preprocessed_chs[0][0][1])
|
456 |
|
457 |
# Step 7: Perform inference using the functions from inference.py
|
458 |
+
output_emb = inference.lwm_inference(preprocessed_chs, 'cls_emb', model)
|
459 |
output_raw = inference.create_raw_dataset(preprocessed_chs, device)
|
460 |
|
461 |
print(f"Output Embeddings Shape: {output_emb.shape}")
|