Downloads · 30 days
5
38% of all-time downloads
Mujahid8065/vroberta-regression
vroberta-regression is a machine learning model from Mujahid8065. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A fine-tuned RoBERTa model for sequence classification with regression problem type.
Downloads · 30 days
5
38% of all-time downloads
All-time downloads
13
Public
Parameters
125M
499 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors499 MB · 99%
From the Hugging Face model README
A fine-tuned RoBERTa model for sequence classification with regression problem type.
RobertaForSequenceClassificationRobertaTokenizer<s>, </s>, <pad>, <unk>, <mask>model.safetensors - Model weights in SafeTensors formatconfig.json - Model configurationtokenizer.json - Tokenizer model filetokenizer_config.json - Tokenizer configurationvocab.json - Vocabulary filemerges.txt - BPE merge rulesspecial_tokens_map.json - Special tokens mappingtraining_args.bin - Training arguments (binary)pip install transformers torch
from transformers import RobertaForSequenceClassification, RobertaTokenizer
import torch
# Load tokenizer and model
tokenizer = RobertaTokenizer.from_pretrained("./")
model = RobertaForSequenceClassification.from_pretrained("./")
# Set model to evaluation mode
model.eval()
# Example text
text = "Your input text here"
# Tokenize input
inputs = tokenizer(
text,
return_tensors="pt",
truncation=True,
max_length=512,
padding=True
)
# Get predictions
with torch.no_grad():
outputs = model(**inputs)
predictions = outputs.logits
# For regression, the output is a continuous value
predicted_value = predictions.item()
print(f"Predicted value: {predicted_value}")
# Multiple texts
texts = ["Text 1", "Text 2", "Text 3"]
# Tokenize
inputs = tokenizer(
texts,
return_tensors="pt",
truncation=True,
max_length=512,
padding=True
)
# Predict
with torch.no_grad():
outputs = model(**inputs)
predictions = outputs.logits
# Get predictions for each text
for i, text in enumerate(texts):
print(f"Text: {text}")
print(f"Predicted value: {predictions[i].item()}")
Please refer to the original RoBERTa model license and any additional terms specified for this fine-tuned model.