Text Generation
Safetensors
English
gemma4
unsloth
gemma-4
classification
esco
occupations
taxonomy
conversational
Instructions to use mazafard/esco-gemma4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Desktop
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -83,16 +83,28 @@ This model is a fine-tuned version of `gemma-4` designed to map candidate skills
|
|
| 83 |
|
| 84 |
---
|
| 85 |
|
| 86 |
-
##
|
| 87 |
|
| 88 |
-
|
| 89 |
-
Test candidate skills directly in your browser:
|
| 90 |
-
👉 [https://huggingface.co/spaces/mazafard/esco-gemma4-demo](https://huggingface.co/spaces/mazafard/esco-gemma4-demo)
|
| 91 |
|
| 92 |
-
###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
```python
|
| 94 |
from unsloth import FastLanguageModel
|
| 95 |
|
|
|
|
| 96 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 97 |
model_name="mazafard/esco-gemma4",
|
| 98 |
max_seq_length=2048,
|
|
@@ -101,26 +113,64 @@ model, tokenizer = FastLanguageModel.from_pretrained(
|
|
| 101 |
)
|
| 102 |
FastLanguageModel.for_inference(model)
|
| 103 |
|
| 104 |
-
|
|
|
|
| 105 |
|
| 106 |
### Instruction:
|
| 107 |
Map the following professional skills and experience to the correct ESCO occupation title and ISCO-08 code.
|
| 108 |
|
| 109 |
### Input:
|
| 110 |
-
|
| 111 |
|
| 112 |
### Response:
|
| 113 |
"""
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
```
|
| 118 |
|
| 119 |
-
###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
```bash
|
| 121 |
ollama run hf.co/mazafard/esco-gemma4-GGUF:q4_k_m
|
| 122 |
```
|
| 123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
## Training Framework
|
| 125 |
- **Base Model**: Google Gemma 4 (4-bit QLoRA)
|
| 126 |
- **Fine-Tuning Engine**: [Unsloth](https://github.com/unslothai/unsloth)
|
|
|
|
| 83 |
|
| 84 |
---
|
| 85 |
|
| 86 |
+
## 📝 Prompt Formatting & Unsloth Usage
|
| 87 |
|
| 88 |
+
This model was trained using the standardized **Alpaca prompt template**. For optimal occupational classification, format your inputs as follows:
|
|
|
|
|
|
|
| 89 |
|
| 90 |
+
### Prompt Template:
|
| 91 |
+
```text
|
| 92 |
+
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
| 93 |
+
|
| 94 |
+
### Instruction:
|
| 95 |
+
Map the following professional skills and experience to the correct ESCO occupation title and ISCO-08 code.
|
| 96 |
+
|
| 97 |
+
### Input:
|
| 98 |
+
<ENTER_CANDIDATE_SKILLS_HERE>
|
| 99 |
+
|
| 100 |
+
### Response:
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
### Complete Python Inference with Unsloth:
|
| 104 |
```python
|
| 105 |
from unsloth import FastLanguageModel
|
| 106 |
|
| 107 |
+
# 1. Load fine-tuned 16-bit or 4-bit model
|
| 108 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 109 |
model_name="mazafard/esco-gemma4",
|
| 110 |
max_seq_length=2048,
|
|
|
|
| 113 |
)
|
| 114 |
FastLanguageModel.for_inference(model)
|
| 115 |
|
| 116 |
+
# 2. Define the Alpaca prompt template
|
| 117 |
+
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
| 118 |
|
| 119 |
### Instruction:
|
| 120 |
Map the following professional skills and experience to the correct ESCO occupation title and ISCO-08 code.
|
| 121 |
|
| 122 |
### Input:
|
| 123 |
+
{}
|
| 124 |
|
| 125 |
### Response:
|
| 126 |
"""
|
| 127 |
+
|
| 128 |
+
# 3. Format input skills
|
| 129 |
+
skills = "Kubernetes, Docker container orchestration, Terraform IaC, CI/CD pipeline automation, Python, Prometheus monitoring, AWS cloud infrastructure"
|
| 130 |
+
|
| 131 |
+
inputs = tokenizer(
|
| 132 |
+
[alpaca_prompt.format(skills)],
|
| 133 |
+
return_tensors="pt"
|
| 134 |
+
).to("cuda")
|
| 135 |
+
|
| 136 |
+
# 4. Generate deterministic output
|
| 137 |
+
outputs = model.generate(
|
| 138 |
+
**inputs,
|
| 139 |
+
max_new_tokens=64,
|
| 140 |
+
use_cache=True,
|
| 141 |
+
temperature=0.1,
|
| 142 |
+
do_sample=False
|
| 143 |
+
)
|
| 144 |
+
|
| 145 |
+
decoded = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 146 |
+
response = decoded.split("### Response:")[-1].strip()
|
| 147 |
+
print("🎯 ESCO Classification Result:
|
| 148 |
+
", response)
|
| 149 |
```
|
| 150 |
|
| 151 |
+
### Expected Model Output Format:
|
| 152 |
+
```text
|
| 153 |
+
ESCO Occupation Title: Cloud Engineer / DevOps Specialist
|
| 154 |
+
ISCO-08 Code: 2512
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
---
|
| 158 |
+
|
| 159 |
+
## ⚡ Edge & Local Runtime Quickstart
|
| 160 |
+
|
| 161 |
+
### Ollama (Desktop / CLI)
|
| 162 |
```bash
|
| 163 |
ollama run hf.co/mazafard/esco-gemma4-GGUF:q4_k_m
|
| 164 |
```
|
| 165 |
|
| 166 |
+
### Apple Silicon Native MLX (macOS)
|
| 167 |
+
```bash
|
| 168 |
+
mlx_lm.generate \
|
| 169 |
+
--model mazafard/esco-gemma4-MLX \
|
| 170 |
+
--prompt "### Instruction:\nMap the following professional skills and experience to the correct ESCO occupation title and ISCO-08 code.\n\n### Input:\nKubernetes, Docker, CI/CD\n\n### Response:\n" \
|
| 171 |
+
--max-tokens 64
|
| 172 |
+
```
|
| 173 |
+
|
| 174 |
## Training Framework
|
| 175 |
- **Base Model**: Google Gemma 4 (4-bit QLoRA)
|
| 176 |
- **Fine-Tuning Engine**: [Unsloth](https://github.com/unslothai/unsloth)
|