transformers tensorboard safetensors mpnet question-answering autotrain base_model:sentence-transformers/all-mpnet-base-v2 base_model:finetune:sentence-transformers/all-mpnet-base-v2 endpoints_compatible region:us
---
base_model: sentence-transformers/all-mpnet-base-v2
library_name: transformers
tags:
- autotrain
- question-answering
widget:
- text: Who loves AutoTrain?
  context: Everyone loves AutoTrain
---

# Model Trained Using AutoTrain

- Problem type: Extractive Question Answering

## Validation Metrics

loss: 5.707379341125488

exact_match: 0.0

f1: 0.0

runtime: 13.0624

samples_per_second: 0.766

steps_per_second: 0.077

: 3.0

## Usage


```python
import torch

from transformers import AutoModelForQuestionAnswering, AutoTokenizer

model = AutoModelForQuestionAnswering.from_pretrained(...)

tokenizer = AutoTokenizer.from_pretrained(...)

from transformers import BertTokenizer, BertForQuestionAnswering

question, text = "Who loves AutoTrain?", "Everyone loves AutoTrain"

inputs = tokenizer(question, text, return_tensors='pt')

start_positions = torch.tensor([1])

end_positions = torch.tensor([3])

outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)

loss = outputs.loss

start_scores = outputs.start_logits

end_scores = outputs.end_logits
```
