Llama 3.2 Amharic
Collection
Llama 3.2 decoder transformer models trained on Amharic text • 12 items • Updated • 1
How to use rasyosef/llama-3.2-amharic-64k-1024 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="rasyosef/llama-3.2-amharic-64k-1024") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("rasyosef/llama-3.2-amharic-64k-1024")
model = AutoModelForCausalLM.from_pretrained("rasyosef/llama-3.2-amharic-64k-1024")How to use rasyosef/llama-3.2-amharic-64k-1024 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "rasyosef/llama-3.2-amharic-64k-1024"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "rasyosef/llama-3.2-amharic-64k-1024",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/rasyosef/llama-3.2-amharic-64k-1024
How to use rasyosef/llama-3.2-amharic-64k-1024 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "rasyosef/llama-3.2-amharic-64k-1024" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "rasyosef/llama-3.2-amharic-64k-1024",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "rasyosef/llama-3.2-amharic-64k-1024" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "rasyosef/llama-3.2-amharic-64k-1024",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use rasyosef/llama-3.2-amharic-64k-1024 with Docker Model Runner:
docker model run hf.co/rasyosef/llama-3.2-amharic-64k-1024
This is a smaller version of the Meta's Llama-3.2-1B decoder transformer model pretrained from scratch for 3 days on 210 million tokens of Amharic text.
First, you need to install the latest version of transformers
pip install -Uq transformers
You can use this model directly with a pipeline for text generation:
from transformers import pipeline
llama_am = pipeline(
"text-generation",
model="rasyosef/llama-3.2-amharic-64k-1024"
)
prompt = "በ ኢንግሊዝ ፕሪምየር ሊግ"
llama_am(
prompt,
max_new_tokens=256,
temperature=0.3,
do_sample=True,
top_k=8,
top_p=0.8,
repetition_penalty=1.25
)
Output:
[{'generated_text': 'በ ኢንግሊዝ ፕሪምየር ሊግ ማንቼስተር ዩናይትድ ከስቶክ ሢቲይ የሚያደርጉትን ጨዋታ በቀጥታ ስርጭት ይመልከቱ ። | አባይ ሚዲያ\nየቮይስ ኦፍ አሜሪካው የስፖርት እና የባህል ፌስቲቫል ሊጀመር ነው።\nየእንግሊዝ ፕሪሚየር ሊግ የሳምንቱ መጨረሻ ጨዋታዎች በሳምንቱ የመጨረሻ ቀናት ተካሂደዋል። ሊጉ ቅዳሜ እለት በተደረጉ ሁለት ግጥሚያዎች ቀጥሎ ሲውል፤ ትናንት ምሽት ደግሞ ማንቸስተር ሲቲ በሊቨርፑል 3 ለ1 ተሸንፏል።\nየሊቨርፑሉ አሰልጣኝ ዬርገን ክሎፕ ቡድናቸውን በአምበልነት እየመራ ወደሜዳ የገቡት ሊቨርፑሎች በፕሬሚየር ሊጉ ጉዟቸው ላይ ወሳኝ ድል ለማስመዝገብ በማለም መሆኑን ተናግረዋል።\n«ዛሬ ማታ ስጫወት አምሽቼ ነበር» ያሉት አሰልጣኙ «አሁን ግን ጠንክሬ እየሰራሁ ነው» ብለዋል።\nበሊጉ የደረጃ ሰንጠረዡን በቀዳሚነት የሚመራው ሊቨርፑል ከተከታዩ ቦሩስያ ዶርትሙንድ ጋር ያለው ልዩነት የ11 ነጥብ ብቻ ሲሆን ፤ መሪው ባየር ሙይንሽን በ7 ይከተላል። ከትናንት በስትያ ኃያሉ ባየርን ሙንሽን በደረጃ ሠንጠረዡ ሦስተኛ ኾኖ በማጠናቀቅ በቡንደስ ሊጋው ለመቆየት የነበረውን ዕድል አምክኗል።\nበእንግሊዝ ፕሬሚየር ሊግ የእግር ኳስ ግጥሚያ ትናንት አርሰናል ኒውካስልን 2 ለባዶ አሸንፏል። ቸልሲ ሳውዝሐምፕተን ውስጥ ትናንት አንድ እኩል አቻ ተለያይቷል። በትናንቱ ሽንፈት አርሰናል ሁለተኛ ደረጃውን አስጠብቋል። ማንቸስተር ዩናይትድም በግብ ክፍያ ተበልጦ አራተኛ ደረጃ ይዟል።\nበስፔን ላሊጋ ትናንት ባርሴሎና ቫሌንሺያን 4 ለዜሮ አንኮታኩቶዋል። ሪያል ማድሪድ ሌቫንቴን 5ለ0 እንዲሁም አትሌቲኮ ቢልባዎ ቤቲስን 6ለ1 አሸንፈዋል። ሊዮኔል ሜሲ በባርሴሎና የግብ ናዳ ወርዶበት ከሜዳ'}]