financial-ttm / example_usage.py
SatyamSinghal's picture
Upload example_usage.py with huggingface_hub
a3cd121 verified
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!")