| import torch | |
| from huggingface_hub import hf_hub_download | |
| # Download the model from Hugging Face | |
| model_path = hf_hub_download(repo_id="SatyamSinghal/financial-ttm", filename="financial_ttm_model.pth") | |
| # Load model data | |
| model_data = torch.load(model_path) | |
| # Extract model configuration | |
| config = model_data['config'] | |
| print(f"Model configuration: {config}") | |
| # To reconstruct the model, you would use: | |
| # from models import FinancialTTM | |
| # model = FinancialTTM(**config) | |
| # model.load_state_dict(model_data['state_dict']) | |
| print("Model loaded successfully!") | |