from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_name ="pszemraj/ModernBERT2Olmo-large_1b-cfg2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
ARTICLE_TO_SUMMARIZE = (
"PG&E stated it scheduled the blackouts in response to forecasts for high winds ""amid dry conditions. The aim is to reduce the risk of wildfires. Nearly 800 thousand customers were ""scheduled to be affected by the shutoffs which were expected to last through at least midday tomorrow."
)
prompt = f"summarize dis botmon: {ARTICLE_TO_SUMMARIZE}"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
# autoregressively generate summary (uses greedy decoding by default)
generated_ids = model.generate(
**inputs,
min_new_tokens=10,
max_new_tokens=100,
)
generated_text = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(generated_text)
Runs of pszemraj ModernBERT2Olmo-large_1b-cfg2 on huggingface.co
19
Total runs
0
24-hour runs
2
3-day runs
1
7-day runs
16
30-day runs
More Information About ModernBERT2Olmo-large_1b-cfg2 huggingface.co Model
More ModernBERT2Olmo-large_1b-cfg2 license Visit here:
ModernBERT2Olmo-large_1b-cfg2 huggingface.co is an AI model on huggingface.co that provides ModernBERT2Olmo-large_1b-cfg2's model effect (), which can be used instantly with this pszemraj ModernBERT2Olmo-large_1b-cfg2 model. huggingface.co supports a free trial of the ModernBERT2Olmo-large_1b-cfg2 model, and also provides paid use of the ModernBERT2Olmo-large_1b-cfg2. Support call ModernBERT2Olmo-large_1b-cfg2 model through api, including Node.js, Python, http.
ModernBERT2Olmo-large_1b-cfg2 huggingface.co is an online trial and call api platform, which integrates ModernBERT2Olmo-large_1b-cfg2's modeling effects, including api services, and provides a free online trial of ModernBERT2Olmo-large_1b-cfg2, you can try ModernBERT2Olmo-large_1b-cfg2 online for free by clicking the link below.
pszemraj ModernBERT2Olmo-large_1b-cfg2 online free url in huggingface.co:
ModernBERT2Olmo-large_1b-cfg2 is an open source model from GitHub that offers a free installation service, and any user can find ModernBERT2Olmo-large_1b-cfg2 on GitHub to install. At the same time, huggingface.co provides the effect of ModernBERT2Olmo-large_1b-cfg2 install, users can directly use ModernBERT2Olmo-large_1b-cfg2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
ModernBERT2Olmo-large_1b-cfg2 install url in huggingface.co: