Instructions to use ashishkat/summarization with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ashishkat/summarization with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("ashishkat/summarization") model = AutoModelForSeq2SeqLM.from_pretrained("ashishkat/summarization") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
### encode the input paragraph to summarize
tokenized_text = tokenizer.encode_plus(
str(text_input),
return_attention_mask = True,
return_tensors="pt")
### pass the tokenized paragraph in model
generated_token = model.generate(
input_ids = tokenized_text["input_ids"],
attention_mask=tokenized_text["attention_mask"],
max_length = 256,
use_cache=True,
)
### decode the summarized paragraph token
summarized_paragraph = [
tokenizer.decode(token_ids=ids, skip_special_tokens=True) for ids in generated_token
]
Summarized paragraph is the final result.
- Downloads last month
- 2
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support