Download fin-mm/code/fix_manifest_paths.py from GoldenGrapeGentleman1/FinMM-MultiModal-Forecasting: direct link, hf CLI and curl.
- Browser
- Download file 747 Bytes
-
https://huggingface.co/GoldenGrapeGentleman1/FinMM-MultiModal-Forecasting/resolve/main/fin-mm/code/fix_manifest_paths.py
- Command line
-
hf download hf://GoldenGrapeGentleman1/FinMM-MultiModal-Forecasting/fin-mm/code/fix_manifest_paths.py
-
curl -L -o fix_manifest_paths.py https://huggingface.co/GoldenGrapeGentleman1/FinMM-MultiModal-Forecasting/resolve/main/fin-mm/code/fix_manifest_paths.py
747 Bytes
| """Fix Windows path separators in manifest file for Linux compatibility.""" | |
| import json | |
| manifest_path = '/home/amd/yueyuan/Finance/fin-mm/data/paired_dataset/manifest_pred20.json' | |
| with open(manifest_path, 'r', encoding='utf-8') as f: | |
| data = json.load(f) | |
| count = 0 | |
| for split_name in data['splits']: | |
| for sample in data['splits'][split_name]: | |
| if '\\' in sample['csv_path']: | |
| sample['csv_path'] = sample['csv_path'].replace('\\', '/') | |
| count += 1 | |
| if '\\' in sample['png_path']: | |
| sample['png_path'] = sample['png_path'].replace('\\', '/') | |
| with open(manifest_path, 'w', encoding='utf-8') as f: | |
| json.dump(data, f, indent=2) | |
| print(f"Fixed {count} paths in manifest!") | |