This model is a fine-tuned version of
unsloth/gemma-3-270m-it for emojify conversion.
It was trained using LoRA (Low-Rank Adaptation) with the
unsloth library for efficient fine-tuning.
This model converts natural language text into emoji representations, learning to identify the most appropriate emojis
that capture the semantic meaning and emotional content of the input text.
This model was trained on the
marioparreno/emojify-sft dataset.
Example predictions were logged to Weights & Biases during training. Please view the training run for detailed examples.
To see prediction examples, visit the W&B dashboard linked above and check the "eval/examples" table.
1from unsloth import FastModel
2from unsloth.chat_templates import get_chat_template
3
4# Load the fine-tuned model
5model, tokenizer = FastModel.from_pretrained(
6 model_name="marioparreno/emojify-sft",
7 max_seq_length=256,
8 load_in_4bit=True,
9)
10
11# Setup chat template
12tokenizer = get_chat_template(
13 tokenizer,
14 chat_template="gemma3",
15)
16
17# Prepare input
18messages = [
19 {"role": "system", "content": "Translate this text to emoji:"},
20 {"role": "user", "content": "I love programming in Python!"}
21]
22inputs = tokenizer.apply_chat_template(
23 messages,
24 tokenize=True,
25 add_generation_prompt=True,
26 return_tensors="pt",
27).to("cuda")
28
29# Generate
30outputs = model.generate(
31 input_ids=inputs,
32 max_new_tokens=32,
33 temperature=1.0,
34 top_p=0.95,
35 top_k=64,
36)
37
38# Decode
39response = tokenizer.decode(outputs[0], skip_special_tokens=True)
40print(response)
1# Chat Template Parts
2instruction_part: "<start_of_turn>user
3"
4response_part: "<start_of_turn>model
5"
6
7# Evaluation
8eval_strategy: "steps"
9eval_steps: 50
10logging_steps: 10