AphasiaPred / test_huggingface.py
SreekarB's picture
Upload 4 files
e4a8a19 verified
"""
Simple test script to verify the Huggingface app works locally.
This will run the app with synthetic data.
"""
import numpy as np
import pandas as pd
import os
# Ensure directories exist
os.makedirs('results', exist_ok=True)
os.makedirs('models', exist_ok=True)
# Create synthetic data
print("Creating synthetic test data...")
n_samples = 10
n_features = 100
# Create FC matrix data
fc_data = np.random.randn(n_samples, n_features)
np.save('results/test_fc.npy', fc_data)
print(f"Saved FC matrix data to results/test_fc.npy with shape {fc_data.shape}")
# Create demographics data
demo_df = pd.DataFrame({
'age': np.random.normal(60, 10, n_samples),
'sex': np.random.choice(['M', 'F'], n_samples),
'months_post_stroke': np.random.normal(24, 12, n_samples),
'wab_score': np.random.normal(65, 15, n_samples)
})
demo_df.to_csv('results/test_demographics.csv', index=False)
print(f"Saved demographics data to results/test_demographics.csv with shape {demo_df.shape}")
print("\nTest data created successfully!")
print("\nNow you can run: python app.py")
print("Then upload the test files to train a model.")