Downloads · 30 days
45
8% of all-time downloads
FatihJimale/gpt2-medium-somali
gpt2-medium-somali is a machine learning model from FatihJimale. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Short description: A Somali text generation model based on GPT‑2 Medium (≈345M parameters). Optimized for general Somali generation: headlines, news‑style sentences, short stories, and assistant‑like completions. This…
Downloads · 30 days
45
8% of all-time downloads
All-time downloads
550
Public
Parameters
355M
1.4 GB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
Short description: A Somali text generation model based on GPT‑2 Medium (≈345M parameters). Optimized for general Somali generation: headlines, news‑style sentences, short stories, and assistant‑like completions. This repository is intended only for generation use cases.
Suggested model ID:
FatihJimale/gpt2-medium-somali
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "FatihJimale/gpt2-medium-somali"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
prompt = "qarax xoogan ayaa ka dhacay magaalada"
inputs = tok(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=80,
do_sample=True,
temperature=0.9,
top_p=0.92,
repetition_penalty=1.08,
)
print(tok.decode(outputs[0], skip_special_tokens=True))
repetition_penalty to 1.1–1.2 or lower temperature (0.7–0.9).max_new_tokens and set top_p around 0.9.do_sample=False, tune top_k=None, temperature=1.0.ml.g5.24xlarge — 4× NVIDIA A10 (24 GB each), 96 vCPU, 384 GiB RAM; data-parallel across 4 GPUsNote: Dataset specifics and cleaning steps are intentionally not disclosed here, per the author's request. This card focuses on model size, parameters, and usage.
config.json
pytorch_model.bin (or model.safetensors)
merges.txt
vocab.json
tokenizer.json
tokenizer_config.json
special_tokens_map.json (if any)
README.md (this file)
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "FatihJimale/gpt2-medium-somali"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
prompt = "qarax xoogan ayaa ka dhacay magaalada"
inputs = tok(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=80, do_sample=True, temperature=0.9, top_p=0.92, repetition_penalty=1.08)
print(tok.decode(outputs[0], skip_special_tokens=True))
@software{gpt2_medium_somali_2025,
title = {GPT-2 Medium Somali},
author = {Mohamed Abdirizak Ahmed},
year = {2025},
url = {https://huggingface.co/FatihJimale/gpt2-medium-somali}
}
This model can produce hallucinations and harmful content. Use with content filters and human review. Do not use for medical, legal, or financial advice.