michealnaye/AmharicCLIP
0
AmharicCLIP
Stable Diffusion v1.5 extended to support Amharic (Ethiopic script) prompts.
This repository contains three components โ each with its own documentation:
Quick Start
from diffusers import StableDiffusionPipeline
from huggingface_hub import snapshot_download
import torch
# Download pipeline from HuggingFace
path = snapshot_download(
repo_id="michealnaye/AmharicCLIP",
allow_patterns="pipeline/*",
)
# Load pipeline
pipe = StableDiffusionPipeline.from_pretrained(
f"{path}/pipeline",
torch_dtype=torch.float16,
safety_checker=None,
)
pipe = pipe.to("cuda")
# Generate from Amharic prompt
image = pipe("แจแตแแต แแถ").images[0] # photo of a cat
image.save("cat.png")Example Results
The Problem We Solved
OpenAI's CLIP tokenizer has no Amharic vocabulary. Each Ethiopic character fragments into 9 byte-level tokens, causing:
- Severe context window waste (77-token limit hit quickly)
- Meaningless embeddings โ SD generates noise instead of images
Our fix reduces token count by 66% and achieves 100% round-trip fidelity.
Citation
@misc{amharicclip2024,
title={AmharicCLIP: Extending CLIP to Amharic via Atomic Tokenization and Knowledge Distillation},
author={Micheal Naye},
year={2024},
publisher={HuggingFace},
url={https://huggingface.co/michealnaye/AmharicCLIP}
}