Spaces:
Running
Running
Sadjad Alikhani
commited on
Update app.py
Browse files
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.
|
103 |
-
labels = np.
|
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"
|