Instructions to use arirajuns/bigbird-legal-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use arirajuns/bigbird-legal-onnx with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "summarization" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("summarization", model="arirajuns/bigbird-legal-onnx")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("arirajuns/bigbird-legal-onnx") model = AutoModelForSeq2SeqLM.from_pretrained("arirajuns/bigbird-legal-onnx", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 630 Bytes
b6242f8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ---
tags:
- onnx
- summarization
- bigbird
- legal
library_name: transformers
base_model: google/bigbird-pegasus-large-arxiv
---
# Legal BigBird (ONNX)
This is a fine-tuned version of **BigBird-Pegasus** for legal document summarization.
It has been exported to **ONNX** for high-performance inference.
## Usage
```python
import onnxruntime as ort
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("arirajuns/bigbird-legal-onnx")
session = ort.InferenceSession("model.onnx")
inputs = tokenizer("Your long legal text here...", return_tensors="np")
outputs = session.run(None, dict(inputs))
```
|