Views
No views yet
| Component | Folder | Description |
|---|---|---|
| 🔤 Text Encoder | text_encoder/ | Fine-tuned CLIPTextModel with Amharic support |
| 📝 Tokenizer | tokenizer/ | Patched tokenizer with 512 Ethiopic atomic tokens |
| 🖼️ Full Pipeline | pipeline/ | Complete SD v1.5 with Amharic text encoder |
1from diffusers import StableDiffusionPipeline
2from huggingface_hub import snapshot_download
3import torch
4
5# Download pipeline from HuggingFace
6path = snapshot_download(
7 repo_id="michealnaye/AmharicCLIP",
8 allow_patterns="pipeline/*",
9)
10
11# Load pipeline
12pipe = StableDiffusionPipeline.from_pretrained(
13 f"{path}/pipeline",
14 torch_dtype=torch.float16,
15 safety_checker=None,
16)
17pipe = pipe.to("cuda")
18
19# Generate from Amharic prompt
20image = pipe("የድመት ፎቶ").images[0] # photo of a cat
21image.save("cat.png")| Amharic Prompt | English | Generated |
|---|---|---|
| የድመት ፎቶ | photo of a cat | ✓ |
| የውሻ ፎቶ | photo of a dog | ✓ |
| የዝሆን ፎቶ | photo of an elephant | ✓ |
| የፈረስ ፎቶ | photo of a horse | ✓ |
| የቢራቢሮ ፎቶ | photo of a butterfly | ✓ |
1@misc{amharicclip2024,
2 title={AmharicCLIP: Extending CLIP to Amharic via Atomic Tokenization and Knowledge Distillation},
3 author={Micheal Naye},
4 year={2024},
5 publisher={HuggingFace},
6 url={https://huggingface.co/michealnaye/AmharicCLIP}
7}