Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,21 +1,165 @@
|
|
| 1 |
---
|
| 2 |
-
base_model: unsloth/gemma-3-270m-it-unsloth-bnb-4bit
|
| 3 |
-
tags:
|
| 4 |
-
- text-generation-inference
|
| 5 |
-
- transformers
|
| 6 |
-
- unsloth
|
| 7 |
-
- gemma3_text
|
| 8 |
-
license: apache-2.0
|
| 9 |
language:
|
| 10 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
This
|
| 20 |
|
| 21 |
-
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
base_model: unsloth/gemma-3-270m-it
|
| 6 |
+
tags:
|
| 7 |
+
- emojify
|
| 8 |
+
- emoji
|
| 9 |
+
- emojification
|
| 10 |
+
- fine-tuned
|
| 11 |
+
- unsloth
|
| 12 |
+
- lora
|
| 13 |
+
- peft
|
| 14 |
+
library_name: transformers
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# marioparreno/emojify-sft
|
| 19 |
+
|
| 20 |
+
This model is a fine-tuned version of [unsloth/gemma-3-270m-it](https://huggingface.co/unsloth/gemma-3-270m-it) for emojify conversion.
|
| 21 |
+
It was trained using LoRA (Low-Rank Adaptation) with the [unsloth](https://github.com/unslothai/unsloth) library for efficient fine-tuning.
|
| 22 |
+
|
| 23 |
+
## Model Description
|
| 24 |
+
|
| 25 |
+
This model converts natural language text into emoji representations, learning to identify the most appropriate emojis
|
| 26 |
+
that capture the semantic meaning and emotional content of the input text.
|
| 27 |
+
|
| 28 |
+
## Training Details
|
| 29 |
+
|
| 30 |
+
### Base Model
|
| 31 |
+
- **Model**: unsloth/gemma-3-270m-it
|
| 32 |
+
- **Architecture**: Gemma-3
|
| 33 |
+
- **Context Length**: 256 tokens
|
| 34 |
+
|
| 35 |
+
### LoRA Configuration
|
| 36 |
+
- **LoRA Rank (r)**: 16
|
| 37 |
+
- **LoRA Alpha**: 32
|
| 38 |
+
- **LoRA Dropout**: 0.0
|
| 39 |
+
- **Target Modules**: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
|
| 40 |
+
|
| 41 |
+
### Quantization
|
| 42 |
+
- **4-bit Quantization**: True
|
| 43 |
+
- **8-bit Quantization**: False
|
| 44 |
+
|
| 45 |
+
### Training Hyperparameters
|
| 46 |
+
|
| 47 |
+
- **Training Epochs**: 3
|
| 48 |
+
- **Batch Size (per device)**: 8
|
| 49 |
+
- **Gradient Accumulation Steps**: 1
|
| 50 |
+
- **Effective Batch Size**: 8
|
| 51 |
+
- **Learning Rate**: 5e-05
|
| 52 |
+
- **Optimizer**: adamw_8bit
|
| 53 |
+
- **Weight Decay**: 0.01
|
| 54 |
+
- **Warmup Steps**: 5
|
| 55 |
+
- **LR Scheduler**: linear
|
| 56 |
+
- **Training Method**: Supervised Fine-Tuning (SFT) with `train_on_responses_only`
|
| 57 |
+
- **Gradient Checkpointing**: unsloth
|
| 58 |
+
- **Training Random Seed**: 3407
|
| 59 |
+
- **Random State (Model Init)**: 3407
|
| 60 |
+
|
| 61 |
+
### Training Results
|
| 62 |
+
|
| 63 |
+
- **Total Training Steps**: 759
|
| 64 |
+
- **Final Training Loss**: 2.1543
|
| 65 |
+
- **Final Emoji Accuracy**: 91.09%
|
| 66 |
+
- **Emoji-Only Predictions**: 460 / 505
|
| 67 |
+
|
| 68 |
+
### Training Monitoring
|
| 69 |
+
|
| 70 |
+
Training was monitored using Weights & Biases:
|
| 71 |
+
- **W&B Run**: [7yqewsom](https://wandb.ai/marioparreno/huggingface/runs/7yqewsom)
|
| 72 |
+
- **View training curves and metrics**: [Dashboard](https://wandb.ai/marioparreno/huggingface/runs/7yqewsom)
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
## Dataset
|
| 76 |
|
| 77 |
+
This model was trained on the [marioparreno/emojify-sft](https://huggingface.co/datasets/marioparreno/emojify-sft) dataset.
|
| 78 |
+
|
| 79 |
+
### Dataset Statistics
|
| 80 |
+
- **Total Training Examples**: 2,023
|
| 81 |
+
- **Total Test Examples**: 505
|
| 82 |
+
- **Total Examples**: 2,528
|
| 83 |
+
- **Dataset Version**: `1b1ee9e`
|
| 84 |
+
- **Last Modified**: 2026-02-25
|
| 85 |
+
- **Full Commit SHA**: `1b1ee9efd92f1dbba4b3141e53b97e0d466981ba`
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
## Example Predictions
|
| 89 |
+
|
| 90 |
+
The following examples show the model's predictions on the test set:
|
| 91 |
+
|
| 92 |
+
### Example Predictions
|
| 93 |
+
|
| 94 |
+
Example predictions were logged to Weights & Biases during training. Please view the training run for detailed examples.
|
| 95 |
+
To see prediction examples, visit the W&B dashboard linked above and check the "eval/examples" table.
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
## Usage
|
| 99 |
+
|
| 100 |
+
```python
|
| 101 |
+
from unsloth import FastModel
|
| 102 |
+
from unsloth.chat_templates import get_chat_template
|
| 103 |
+
|
| 104 |
+
# Load the fine-tuned model
|
| 105 |
+
model, tokenizer = FastModel.from_pretrained(
|
| 106 |
+
model_name="marioparreno/emojify-sft",
|
| 107 |
+
max_seq_length=256,
|
| 108 |
+
load_in_4bit=True,
|
| 109 |
+
)
|
| 110 |
+
|
| 111 |
+
# Setup chat template
|
| 112 |
+
tokenizer = get_chat_template(
|
| 113 |
+
tokenizer,
|
| 114 |
+
chat_template="gemma3",
|
| 115 |
+
)
|
| 116 |
+
|
| 117 |
+
# Prepare input
|
| 118 |
+
messages = [
|
| 119 |
+
{"role": "system", "content": "Translate this text to emoji:"},
|
| 120 |
+
{"role": "user", "content": "I love programming in Python!"}
|
| 121 |
+
]
|
| 122 |
+
inputs = tokenizer.apply_chat_template(
|
| 123 |
+
messages,
|
| 124 |
+
tokenize=True,
|
| 125 |
+
add_generation_prompt=True,
|
| 126 |
+
return_tensors="pt",
|
| 127 |
+
).to("cuda")
|
| 128 |
+
|
| 129 |
+
# Generate
|
| 130 |
+
outputs = model.generate(
|
| 131 |
+
input_ids=inputs,
|
| 132 |
+
max_new_tokens=32,
|
| 133 |
+
temperature=1.0,
|
| 134 |
+
top_p=0.95,
|
| 135 |
+
top_k=64,
|
| 136 |
+
)
|
| 137 |
+
|
| 138 |
+
# Decode
|
| 139 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 140 |
+
print(response)
|
| 141 |
+
```
|
| 142 |
+
|
| 143 |
+
## Training Configuration
|
| 144 |
+
|
| 145 |
+
```yaml
|
| 146 |
+
# Chat Template Parts
|
| 147 |
+
instruction_part: "<start_of_turn>user
|
| 148 |
+
"
|
| 149 |
+
response_part: "<start_of_turn>model
|
| 150 |
+
"
|
| 151 |
+
|
| 152 |
+
# Evaluation
|
| 153 |
+
eval_strategy: "steps"
|
| 154 |
+
eval_steps: 50
|
| 155 |
+
logging_steps: 10
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
+
## Model Card Authors
|
| 159 |
+
|
| 160 |
+
[Mario Parreño](https://maparla.es)
|
| 161 |
+
|
| 162 |
+
---
|
| 163 |
|
| 164 |
+
*This model card was automatically generated as part of the training pipeline.*
|
| 165 |
|
|
|