加载中…
加载中…
A sequence-to-sequence transformer model fine-tuned to convert conversational logs, transcripts, team syncs, and multi-turn messenger discussions into crisp, third-person narrative summaries.
T5-small)google-t5/t5-small (~60.5 Million parameters)summarize: en)"I fixed it") into clear third-person reporting ("Alex fixed the issue").Speaker: message).import torch
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
# Set your Hugging Face repository identifier
repo_id = "YOUR_HF_USERNAME/t5-small-samsum"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForSeq2SeqLM.from_pretrained(repo_id)
# Sample dialogue input
dialogue = """
Hassan: Did you get the chance to verify the memory leak fix?
Sara: Yes, I ran stress tests against the auth service. Pod memory stayed below 45%.
Hassan: Awesome. Can you deploy it to staging and ping the QA channel?
Sara: Done. Build 142 is live on staging now.
"""
# Format input with task prefix
input_text = f"summarize: {dialogue.strip()}"
inputs = tokenizer(input_text, return_tensors="pt", max_length=512, truncation=True)
# Generate summary using beam search
with torch.no_grad():
output_tokens = model.generate(
inputs["input_ids"],
max_new_tokens=60,
min_length=10,
num_beams=4,
early_stopping=True,
)
summary = tokenizer.decode(output_tokens[0], skip_special_tokens=True)
print("Summary:\n", summary)
google-t5/t5-small