Download example_usage.py from SatyamSinghal/financial-ttm: direct link, hf CLI and curl.
- Browser
- Download file 556 Bytes
-
https://huggingface.co/SatyamSinghal/financial-ttm/resolve/main/example_usage.py
- Command line
-
hf download hf://SatyamSinghal/financial-ttm/example_usage.py
-
curl -L -o example_usage.py https://huggingface.co/SatyamSinghal/financial-ttm/resolve/main/example_usage.py
556 Bytes
| 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!") | |