Views
No views yet
en).glove-wiki-gigaword-100), with Out-Of-Vocabulary (OOV) terms embedded using context-window neighborhood averaging.- (Non-sexist)DIRECT (Directly sexist messages)JUDGEMENTAL (Messages condemning sexist behaviors)REPORTED (Messages reporting a sexist situation)emoji library)nltk.WordNetLemmatizer).pth weights) rather than a standard Hugging Face Transformer, you must instantiate the architecture in your code before loading the weights.1import torch
2from huggingface_hub import hf_hub_download
3
4# 1. Download the weights from the Hub
5weights_path = hf_hub_download(
6 repo_id="your-username/your-repo-name",
7 filename="best_lstm_weights.pth"
8)
9
10# 2. Instantiate your custom model class (BaselineModel or StackedModel)
11# NOTE: You must have your custom class defined in your script
12model = StackedModel()
13
14# 3. Load the state dictionary
15model.load_state_dict(torch.load(weights_path, map_location=torch.device('cpu')))
16model.eval()
17
18print("Model successfully loaded!")