Instructions to use spolivin/bart-arxiv-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use spolivin/bart-arxiv-lora 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="spolivin/bart-arxiv-lora")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("spolivin/bart-arxiv-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -70,6 +70,6 @@ inputs = tokenizer(
|
|
| 70 |
lora_model.to(inputs.input_ids.device)
|
| 71 |
|
| 72 |
# Generating summarized version
|
| 73 |
-
summary_ids = lora_model.generate(**inputs, max_length=
|
| 74 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
| 75 |
```
|
|
|
|
| 70 |
lora_model.to(inputs.input_ids.device)
|
| 71 |
|
| 72 |
# Generating summarized version
|
| 73 |
+
summary_ids = lora_model.generate(**inputs, max_length=250, num_beams=4, early_stopping=True)
|
| 74 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
| 75 |
```
|