Instructions to use anshuKr/sentence-compression with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anshuKr/sentence-compression 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="anshuKr/sentence-compression")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("anshuKr/sentence-compression") model = AutoModelForSeq2SeqLM.from_pretrained("anshuKr/sentence-compression", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 526 Bytes
d4caa5c | 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 | .PHONY: data train eval inference run clean
data:
@echo "Creating dataset from google/sentence_compressiom.."
python -m build_dataset
train:
@echo "Training google/t5-small model for sentence compression.."
python -m fine-tuning
eval:
@echo "Evaluation on test set.."
python -m utils
inference:
@echo "Performing model inference on evaluation data.."
python -m inference
run: clean data train eval inference
clean:
@find . -name "*.pyc" -exec rm {} \;
@rm -rf dataset/preprocessed/* checkpoints/* results/*;
|