Views
No views yet
1from transformers import DistilBertForSequenceClassification, DistilBertTokenizerFast
2import torch
3
4model = DistilBertForSequenceClassification.from_pretrained("scdong/distilbert-response-type")
5tokenizer = DistilBertTokenizerFast.from_pretrained("scdong/distilbert-response-type")
6
7text = "I just feel so overwhelmed lately"
8inputs = tokenizer(text, return_tensors="pt")
9with torch.no_grad():
10 logits = model(**inputs).logits
11
12predicted_label = torch.argmax(logits, dim=1).item()
13print(predicted_label) # Maps to: 0=advice, 1=information, 2=question, 3=validationconfig.json — model architecture configmodel.safetensors — trained model weightstokenizer_config.json, tokenizer.json, vocab.txt — tokenizer filesspecial_tokens_map.json — optional token mappingstraining_args.bin — training metadata (optional)