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
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- onnx
|
| 4 |
+
- summarization
|
| 5 |
+
- bigbird
|
| 6 |
+
- legal
|
| 7 |
+
library_name: transformers
|
| 8 |
+
base_model: google/bigbird-pegasus-large-arxiv
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Legal BigBird (ONNX)
|
| 12 |
+
|
| 13 |
+
This is a fine-tuned version of **BigBird-Pegasus** for legal document summarization.
|
| 14 |
+
It has been exported to **ONNX** for high-performance inference.
|
| 15 |
+
|
| 16 |
+
## Usage
|
| 17 |
+
|
| 18 |
+
```python
|
| 19 |
+
import onnxruntime as ort
|
| 20 |
+
from transformers import AutoTokenizer
|
| 21 |
+
|
| 22 |
+
tokenizer = AutoTokenizer.from_pretrained("arirajuns/bigbird-legal-onnx")
|
| 23 |
+
session = ort.InferenceSession("model.onnx")
|
| 24 |
+
|
| 25 |
+
inputs = tokenizer("Your long legal text here...", return_tensors="np")
|
| 26 |
+
outputs = session.run(None, dict(inputs))
|
| 27 |
+
```
|