Instructions to use WillisBack/gemma-Summarizer-2b-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
How to use WillisBack/gemma-Summarizer-2b-it with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="WillisBack/gemma-Summarizer-2b-it")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("WillisBack/gemma-Summarizer-2b-it")
model = AutoModelForCausalLM.from_pretrained("WillisBack/gemma-Summarizer-2b-it")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
How to use WillisBack/gemma-Summarizer-2b-it with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh
# Run unsloth studio
unsloth studio -H 0.0.0.0 -p 8888
# Then open http://localhost:8888 in your browser
# Search for WillisBack/gemma-Summarizer-2b-it to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex
# Run unsloth studio
unsloth studio -H 0.0.0.0 -p 8888
# Then open http://localhost:8888 in your browser
# Search for WillisBack/gemma-Summarizer-2b-it to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required
# Open https://huggingface.co/spaces/unsloth/studio in your browser
# Search for WillisBack/gemma-Summarizer-2b-it to start chatting