Downloads · 30 days
10
12% of all-time downloads
detker/roberta-qa-125M
roberta-qa-125M is a machine learning model from detker. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains the trained weights for the RoBERTa model fine-tuned for QA with LoRA (Low-Rank Adaptation).
Downloads · 30 days
10
12% of all-time downloads
All-time downloads
86
Public
Parameters
125M
4.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.5 GB · 100%
From the Hugging Face model README
This repository contains the trained weights for the RoBERTa model fine-tuned for QA with LoRA (Low-Rank Adaptation).
.safetensorsconfig.jsonYou can load the model using Hugging Face's AutoModel and AutoConfig classes:
from transformers import AutoModel, AutoConfig, RobertaTokenizerFast
from hf_pretrained_model import RobertaConfigHF, RobertaForQAHF
# Register model
AutoConfig.register('roberta-qa', RobertaConfigHF)
AutoModel.register(RobertaConfigHF, RobertaForQAHF)
# Load config
config = AutoConfig.from_pretrained('detker/roberta-qa-125M')
# Load tokenizer
tokenizer = RobertaTokenizerFast.from_pretrained(config.hf_model_name)
# Load the model
model = AutoModel.from_pretrained('detker/roberta-qa-125M',
trust_remote_code=True)
# Example usage
inputs = tokenizer(
text=question,
text_pair=context,
max_length=config.context_length,
truncation='only_second',
return_tensors='pt'
)
start_logits, end_logits = model(**inputs)
model.safetensors: Trained model weights.config.json: Model configuration file.