Sadjad Alikhani commited on
Commit
b75d54e
·
verified ·
1 Parent(s): 22c7dd7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -97,12 +97,13 @@ def run_inference(uploaded_file):
97
  sys.stdout = capture # Redirect print statements to capture
98
 
99
  try:
100
- # Load the HDF5 file and extract channels and labels
101
  with h5py.File(uploaded_file.name, 'r') as f:
102
- channels = np.array(f['channels']) # Assuming 'channels' dataset in the HDF5 file
103
- labels = np.array(f['labels']) # Assuming 'labels' dataset in the HDF5 file
104
  print(f"Loaded dataset with {channels.shape[0]} samples.")
105
 
 
106
  # Run the tokenization and model inference
107
  model_repo_url = "https://huggingface.co/sadjadalikhani/LWM"
108
  model_repo_dir = "./LWM"
 
97
  sys.stdout = capture # Redirect print statements to capture
98
 
99
  try:
100
+ # Step 5: Load the HDF5 file and extract the channels and labels
101
  with h5py.File(uploaded_file.name, 'r') as f:
102
+ channels = np.asarray(f['channels']) # Use np.asarray to avoid DeprecationWarning
103
+ labels = np.asarray(f['labels']) # Use np.asarray to avoid DeprecationWarning
104
  print(f"Loaded dataset with {channels.shape[0]} samples.")
105
 
106
+
107
  # Run the tokenization and model inference
108
  model_repo_url = "https://huggingface.co/sadjadalikhani/LWM"
109
  model_repo_dir = "./LWM"