How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="mags0ft/SmolLM2-360m-German-Instruct")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("mags0ft/SmolLM2-360m-German-Instruct")
model = AutoModelForCausalLM.from_pretrained("mags0ft/SmolLM2-360m-German-Instruct")
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]:]))
Quick Links

SmolLM2-360m-German-Instruct

Showcase image for SmolLM2-360m-German-Instruct

This is a continued pre-train as well as an instruct fine-tune done using Unsloth in order to make SmolLM2 360m capable of speaking German. It has been trained on 25% of the German Wikipedia as well as the full German version of the Alpaca-GPT4 dataset (translated version).

Even though a lot of training has been done, this is still a tiny model and is highly limited to its small size. Expect many hallucinations and do not use this in a demanding production workflow.

Links

Cite as

@misc{smollm2germaninstruct,
  author       = {Magnus Leonard Schlinsog},
  title        = {Enhancing Foreign Language Proficiency in SmolLM2-360M via Continued Pretraining and Instruction Fine-Tuning},
  year         = {2025},
  url          = {https://huggingface.co/mags0ft/SmolLM2-360m-German-Instruct},
}
Downloads last month
74
Safetensors
Model size
0.4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mags0ft/SmolLM2-360m-German-Instruct

Quantized
(33)
this model

Datasets used to train mags0ft/SmolLM2-360m-German-Instruct