Download fin-mm/code/test_paired_data.py from GoldenGrapeGentleman1/FinMM-code: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/GoldenGrapeGentleman1/FinMM-code/resolve/main/fin-mm/code/test_paired_data.py
- Command line
-
hf download hf://GoldenGrapeGentleman1/FinMM-code/fin-mm/code/test_paired_data.py
-
curl -L -o test_paired_data.py https://huggingface.co/GoldenGrapeGentleman1/FinMM-code/resolve/main/fin-mm/code/test_paired_data.py
1.25 kB
| """Test paired dataset loading on remote machine.""" | |
| import json | |
| from pathlib import Path | |
| DATA_DIR = Path('/home/amd/yueyuan/Finance/fin-mm/data/paired_dataset') | |
| print("=" * 50) | |
| print("Testing Paired Dataset") | |
| print("=" * 50) | |
| # Load manifest | |
| manifest_path = DATA_DIR / 'manifest_pred20.json' | |
| with open(manifest_path, 'r', encoding='utf-8') as f: | |
| manifest = json.load(f) | |
| print(f"\nManifest loaded: {manifest_path}") | |
| print(f"Train samples: {len(manifest['splits']['train'])}") | |
| print(f"Val samples: {len(manifest['splits']['val'])}") | |
| print(f"Test samples: {len(manifest['splits']['test'])}") | |
| # Check first sample | |
| sample = manifest['splits']['train'][0] | |
| print(f"\nFirst train sample: {sample['sample_id']}") | |
| print(f" Input: {sample['input_start']} -> {sample['input_end']} ({sample['input_days']} days)") | |
| print(f" Target: {sample['target_start']} -> {sample['target_end']} ({sample['target_days']} days)") | |
| # Verify files exist | |
| csv_path = DATA_DIR / sample['csv_path'] | |
| png_path = DATA_DIR / sample['png_path'] | |
| print(f" CSV exists: {csv_path.exists()} ({csv_path})") | |
| print(f" PNG exists: {png_path.exists()} ({png_path})") | |
| print("\n" + "=" * 50) | |
| print("[SUCCESS] Dataset ready for training!") | |
| print("=" * 50) | |