This model is a merged LoRA fine-tuned version of
google/gemma-3-1b-it for binary text classification on Swedish text data.
1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="Mohamad-Jaallouk/model-to-production-2.2",
6 device="cuda" # or "cpu"
7)
8
9result = classifier("Din svenska text här")
10print(result)
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_id = "Mohamad-Jaallouk/model-to-production-2.2"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForSequenceClassification.from_pretrained(
8 model_id,
9 torch_dtype=torch.bfloat16,
10 device_map="cuda"
11)
12
13text = "Din svenska text här"
14inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
15inputs = {k: v.to(model.device) for k, v in inputs.items()}
16
17with torch.no_grad():
18 outputs = model(**inputs)
19 prediction = torch.argmax(outputs.logits, dim=-1).item()
20
21print(f"Predicted class: {prediction}")
1@misc{model-to-production-2.2,
2 author = {Mohamad Jaallouk},
3 title = {Model-to-Production v2.2: Swedish Text Classification},
4 year = {2025},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/Mohamad-Jaallouk/model-to-production-2.2}}
7}