Views
No views yet
1from sentimentizer.hf import download_weights
2from sentimentizer.config import weights_path_for
3
4# Download classifier head + backbone from Hugging Face Hub
5weights_path = weights_path_for("modernbert")
6download_weights(
7 "modernbert",
8 weights_path,
9 repo_id="ryeyoo/sentimentizer-modernbert",
10)
11
12# Load and run inference
13from sentimentizer.models.modernbert import new_modernbert_model
14from sentimentizer.predictor import SentimentPredictor
15
16model = new_modernbert_model()
17predictor = SentimentPredictor(model)
18
19result = predictor.predict('amazing food great service')
20print(result)
21# e.g. {'label': 'positive', 'score': 0.83, ...}modernbert_weights.pth — Classifier head weights and config metadatabackbone/ — Hugging Face transformer backbone (safetensors + config)backbone/tokenizer.json — Full tokenizer databackbone/tokenizer_config.json — Tokenizer configuration