children_educational_summarizer
1
license:apache-2.0
by
SeifElden2342532
Language Model
OTHER
New
0 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Code Examples
Usagepythontransformers
import torch
from transformers import AutoTokenizer, BartForConditionalGeneration
from peft import PeftModel
model_id = "SeifElden2342532/children_educational_summarizer"
tokenizer = AutoTokenizer.from_pretrained(model_id)
base = BartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn").to("cuda")
model = PeftModel.from_pretrained(base, model_id)
model = model.merge_and_unload()
model.eval()
text = "your lesson text here..."
inputs = tokenizer(
text,
max_length=1024,
truncation=True,
padding="max_length",
return_tensors="pt",
).to("cuda")
with torch.no_grad():
summary_ids = model.generate(
input_ids = inputs["input_ids"],
attention_mask = inputs["attention_mask"],
num_beams = 4,
max_length = 256,
early_stopping = True,
)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print(summary)Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.