YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

from transformers import AutoTokenizer, GPT2ForSequenceClassification

import torch

model_name= "mab/GPT2-German-sentiment"

tokenizer = AutoTokenizer.from_pretrained(model_name)

model = GPT2ForSequenceClassification.from_pretrained(model_name)

inputs = tokenizer("Mein Hund ist wunderschön", return_tensors="pt")

with torch.no_grad(): logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()

class_label = model.config.id2label[predicted_class_id]

print(class_label)

Downloads last month
10
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.