How to use from the
Use from the
Transformers library
# 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="vatsal18/multi-lang_summay")
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("vatsal18/multi-lang_summay")
model = AutoModelForSeq2SeqLM.from_pretrained("vatsal18/multi-lang_summay")
Quick Links

multi-lang_summay

Fine-tuned seq2seq model for multilingual abstractive summarization.

Usage

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch

repo_id = "vatsal18/multi-lang_summay"
tok = AutoTokenizer.from_pretrained(repo_id)
mdl = AutoModelForSeq2SeqLM.from_pretrained(repo_id).eval()

text = "Paste any article (any supported language) here."
enc = tok(text, return_tensors="pt", truncation=True, max_length=1024)
with torch.no_grad():
    out = mdl.generate(**enc, max_new_tokens=128, num_beams=4, length_penalty=0.8)
print(tok.decode(out[0], skip_special_tokens=True))
Downloads last month
3
Safetensors
Model size
0.6B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support