Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 611 Bytes

File metadata and controls

26 lines (20 loc) · 611 Bytes

build-llm-scratch-manning-experiment

Building LLM from scratch experiment via Manning MEAP

Trained Model

  1. Text Spam Classifier - published in huggingface

Using Model

import torch

....
....
# modify based on CPU/GPU
model_state_dict = torch.load("spam_classifier.pth", map_location=torch.device('cpu'))
    model.load_state_dict(model_state_dict)
text_1 = (
    "I love to go to Waterloo university and summer break"
    ""
)
print(classify_review(
    text_1, model, tokenizer, device, max_length=train_dataset.max_length
))