Text Generation
Transformers
Safetensors
Arabic
English
llama
translation
darija
moroccan-arabic
english
arabic
small-language-model
slm
chatml
text-generation-inference
Instructions to use oddadmix/50M-Darija-English-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use oddadmix/50M-Darija-English-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="oddadmix/50M-Darija-English-v1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("oddadmix/50M-Darija-English-v1") model = AutoModelForCausalLM.from_pretrained("oddadmix/50M-Darija-English-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use oddadmix/50M-Darija-English-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "oddadmix/50M-Darija-English-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "oddadmix/50M-Darija-English-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/oddadmix/50M-Darija-English-v1
- SGLang
How to use oddadmix/50M-Darija-English-v1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "oddadmix/50M-Darija-English-v1" \ --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": "oddadmix/50M-Darija-English-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
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 "oddadmix/50M-Darija-English-v1" \ --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": "oddadmix/50M-Darija-English-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use oddadmix/50M-Darija-English-v1 with Docker Model Runner:
docker model run hf.co/oddadmix/50M-Darija-English-v1
Download eval_bidirectional.json from oddadmix/50M-Darija-English-v1: direct link, hf CLI and curl.
- Browser
- Download file 11.3 kB
-
https://huggingface.co/oddadmix/50M-Darija-English-v1/resolve/main/eval_bidirectional.json
- Command line
-
hf download hf://oddadmix/50M-Darija-English-v1/eval_bidirectional.json
-
curl -L -o eval_bidirectional.json https://huggingface.co/oddadmix/50M-Darija-English-v1/resolve/main/eval_bidirectional.json
11.3 kB
| { | |
| "eval_size": 3000, | |
| "seed": 42, | |
| "generation": { | |
| "do_sample": false, | |
| "repetition_penalty": 1.0, | |
| "no_repeat_ngram_size": 0 | |
| }, | |
| "directions": { | |
| "dar2en": { | |
| "bleu": 39.7232453793599, | |
| "chrf": 53.221902212583714, | |
| "samples": [ | |
| { | |
| "source": "لا، عندنا تذاكر يا حبيبة", | |
| "reference": "No, we have tickets darling", | |
| "hypothesis": "No, we have the tickets, honey" | |
| }, | |
| { | |
| "source": "غطّا وجهو و بكا", | |
| "reference": "He covered his face and wept", | |
| "hypothesis": "he went to his face" | |
| }, | |
| { | |
| "source": "كانتسنّا فيك ت دي هادشي و تستاهلو", | |
| "reference": "I'm waiting for you to deserve this", | |
| "hypothesis": "I'm waiting for you to take this" | |
| }, | |
| { | |
| "source": "\n\nلجدوال ديال الترتيب\n\nشوف حتى \n\n بوطولا 1\n بوطولا 2\n لهيكلة لهرمية د لبوطولات ديال كورة ف لمغريب\n\nعيون لكلام \n\nبوطولا 1\nمقالات فيها مصدر و 3000 بايت", | |
| "reference": "For the dawn of the arrangement\n\nLook even\n\n Potola 1\n Potola 2\n For the structure of the pyramid D for Diyal Koura's Boutra\n\nEyes of words\n\nPotola 1\nArticles with a source and 3000 bytes", | |
| "hypothesis": "For the dawn of the arrangement\n\nLook even\n\n Potola 1\n Potola 2\n For the structure of the pyramid D for Diyal Koura's Boutra\n\nEyes of words\n\nPotola 1\nArticles with a source and 3000 bytes" | |
| }, | |
| { | |
| "source": "راهوم معشششين هنا و بان ليا قريب يخرجو لفراخ ديالهوم من لبيض", | |
| "reference": "They're nesting over there and it looks as if the babies will hatch out soon.", | |
| "hypothesis": "They're not living here and they seem to get out of the eggs" | |
| }, | |
| { | |
| "source": "أفادت التقارير أنه يوجد في المنطقة حوالي 9400 منزل بدون ماء وحوالي 100 منزل بلا كهرباء.", | |
| "reference": "It is reported that some 9400 homes in the region are without water and approximately 100 without electricity. The previous text is in English. Here is a translation to Moroccan Arabic:", | |
| "hypothesis": "It is reported that some 9400 homes in the region are without water and approximately 100 without electricity. The previous text is in English. Here is a translation to Moroccan Arabic:" | |
| }, | |
| { | |
| "source": "نتحداك تعتارد على هاد الموضوع", | |
| "reference": "I dare you to object to this topic", | |
| "hypothesis": "I dare you to help this subject" | |
| }, | |
| { | |
| "source": "walakin hadi awal tsafira ftyyara lia o ana khayfa chwiya", | |
| "reference": "but it's my first flight ever and I'm a little scared", | |
| "hypothesis": "But it's my first flight and I'm a little scared" | |
| }, | |
| { | |
| "source": "شرف ليا نعاونك", | |
| "reference": "Glad to help", | |
| "hypothesis": "i will help you" | |
| }, | |
| { | |
| "source": "معرفتش من إمتا كايفكرو فهاد شي", | |
| "reference": "i dont know why they think", | |
| "hypothesis": "I don't know when they think about it" | |
| }, | |
| { | |
| "source": "سير دير شي حاجة تنافعك", | |
| "reference": "do something that will benefit you", | |
| "hypothesis": "go do something suffering you" | |
| }, | |
| { | |
| "source": "وسبحسام", | |
| "reference": "thirty five past", | |
| "hypothesis": "And the pasta." | |
| }, | |
| { | |
| "source": "هوا كايدحاك بزاف.", | |
| "reference": "That is so funny.", | |
| "hypothesis": "He's gossiping too much." | |
| }, | |
| { | |
| "source": "ناسّ كاتعجبهوم شيكاغو", | |
| "reference": "people love chicago", | |
| "hypothesis": "people like certainly" | |
| }, | |
| { | |
| "source": "ش† كاينين أختي وماهات", | |
| "reference": "there are some mothers", | |
| "hypothesis": "there's sister there and sister" | |
| }, | |
| { | |
| "source": "ghadi ykhSona sway3 bach nrj3o mnin jina, f DDlam, o f wsT ga3 had lghiss ...", | |
| "reference": "It will take us hours to get back the way we came, in the dark, and through all that mud ...", | |
| "hypothesis": "We'll have a walk around turning down mind, in DDlam, and everything's true that this movie will be fun..." | |
| }, | |
| { | |
| "source": "تقدر تعتامد عليا أ الشاف!", | |
| "reference": "You can count on me, boss!", | |
| "hypothesis": "You could call me a chef!" | |
| }, | |
| { | |
| "source": "خلينا غير نبقاو ف روكك", | |
| "reference": "Let's just stay rock", | |
| "hypothesis": "Let's just stay rock" | |
| }, | |
| { | |
| "source": "ولا غادي يخاساك تخدام دروج", | |
| "reference": "Otherwise you’ll have to use the stairs", | |
| "hypothesis": "Or you're gonna have to use the stairs" | |
| }, | |
| { | |
| "source": "شحال ديال لواقت ايخاسنا باش نجاهزو تاجريبا؟", | |
| "reference": "How long do we have to prepare the experiment?", | |
| "hypothesis": "How long do we have to get a experience?" | |
| } | |
| ] | |
| }, | |
| "en2dar": { | |
| "bleu": 43.02710978051853, | |
| "chrf": 52.467598207429724, | |
| "samples": [ | |
| { | |
| "source": "No, we have tickets darling", | |
| "reference": "لا، عندنا تذاكر يا حبيبة", | |
| "hypothesis": "لا، عندنا تاداق ديال لباحت" | |
| }, | |
| { | |
| "source": "He covered his face and wept", | |
| "reference": "غطّا وجهو و بكا", | |
| "hypothesis": "كان كايغطي وجهو و مانڭدّ" | |
| }, | |
| { | |
| "source": "I'm waiting for you to deserve this", | |
| "reference": "كانتسنّا فيك ت دي هادشي و تستاهلو", | |
| "hypothesis": "كانتسنّا فيك ت ستاهل هادشي" | |
| }, | |
| { | |
| "source": "For the dawn of the arrangement\n\nLook even\n\n Potola 1\n Potola 2\n For the structure of the pyramid D for Diyal Koura's Boutra\n\nEyes of words\n\nPotola 1\nArticles with a source and 3000 bytes", | |
| "reference": "لجدوال ديال الترتيب\n\nشوف حتى \n\n بوطولا 1\n بوطولا 2\n لهيكلة لهرمية د لبوطولات ديال كورة ف لمغريب\n\nعيون لكلام \n\nبوطولا 1\nمقالات فيها مصدر و 3000 بايت", | |
| "hypothesis": "لجدوال ديال الترتيب\n\nشوف حتى \n\n بوطولا 1\n بوطولا 2\n لهيكلة لهرمية د لبوطولات ديال كورة ف لمغريب\n\nعيون لكلام \n\nبوطولا 1\nمقالات فيها مصدر و 3000 بايت" | |
| }, | |
| { | |
| "source": "They're nesting over there and it looks as if the babies will hatch out soon.", | |
| "reference": "راهوم معشششين هنا و بان ليا قريب يخرجو لفراخ ديالهوم من لبيض", | |
| "hypothesis": "راه كاين لي غايكونو فيه اقراب اكونو اكبان ايخاس اخرين اكبان اميال خايفو" | |
| }, | |
| { | |
| "source": "It is reported that some 9400 homes in the region are without water and approximately 100 without electricity. The previous text is in English. Here is a translation to Moroccan Arabic:", | |
| "reference": "أفادت التقارير أنه يوجد في المنطقة حوالي 9400 منزل بدون ماء وحوالي 100 منزل بلا كهرباء.", | |
| "hypothesis": "أفادت التقارير أنه يوجد في المنطقة حوالي 9400 منزل بدون ماء وحوالي 100 منزل بلا كهرباء." | |
| }, | |
| { | |
| "source": "I dare you to object to this topic", | |
| "reference": "نتحداك تعتارد على هاد الموضوع", | |
| "hypothesis": "نتحداك تعارض هاد الموضوع" | |
| }, | |
| { | |
| "source": "but it's my first flight ever and I'm a little scared", | |
| "reference": "walakin hadi awal tsafira ftyyara lia o ana khayfa chwiya", | |
| "hypothesis": "والاكين هادي اوال تسافيرا ليا ف طييارا لاولا و انا خايفا شوييا" | |
| }, | |
| { | |
| "source": "Glad to help", | |
| "reference": "شرف ليا نعاونك", | |
| "hypothesis": "l3bat liya n3awn" | |
| }, | |
| { | |
| "source": "i dont know why they think", | |
| "reference": "معرفتش من إمتا كايفكرو فهاد شي", | |
| "hypothesis": "ماعرفتش علاش كايڭولو" | |
| }, | |
| { | |
| "source": "do something that will benefit you", | |
| "reference": "سير دير شي حاجة تنافعك", | |
| "hypothesis": "دير شي حاجة تنفعك" | |
| }, | |
| { | |
| "source": "thirty five past", | |
| "reference": "وسبحسام", | |
| "hypothesis": "سبعة و خمس" | |
| }, | |
| { | |
| "source": "That is so funny.", | |
| "reference": "هوا كايدحاك بزاف.", | |
| "hypothesis": "هادشي كايضحك." | |
| }, | |
| { | |
| "source": "people love chicago", | |
| "reference": "ناسّ كاتعجبهوم شيكاغو", | |
| "hypothesis": "بنادم كايبغي شيكا" | |
| }, | |
| { | |
| "source": "there are some mothers", | |
| "reference": "ش† كاينين أختي وماهات", | |
| "hypothesis": "كاينين شي مفسّين" | |
| }, | |
| { | |
| "source": "It will take us hours to get back the way we came, in the dark, and through all that mud ...", | |
| "reference": "ghadi ykhSona sway3 bach nrj3o mnin jina, f DDlam, o f wsT ga3 had lghiss ...", | |
| "hypothesis": "غادي يخصنا سوايع باش نرجعو منين جينا، ف ضلام، و ف ڭاع هاد طريق .." | |
| }, | |
| { | |
| "source": "You can count on me, boss!", | |
| "reference": "تقدر تعتامد عليا أ الشاف!", | |
| "hypothesis": "امكان ليك تاعمالني، باترون!" | |
| }, | |
| { | |
| "source": "Let's just stay rock", | |
| "reference": "خلينا غير نبقاو ف روكك", | |
| "hypothesis": "خلينا نڭلسو rock" | |
| }, | |
| { | |
| "source": "Otherwise you’ll have to use the stairs", | |
| "reference": "ولا غادي يخاساك تخدام دروج", | |
| "hypothesis": "من غير هادشي لي غادي تاخد دروج" | |
| }, | |
| { | |
| "source": "How long do we have to prepare the experiment?", | |
| "reference": "شحال ديال لواقت ايخاسنا باش نجاهزو تاجريبا؟", | |
| "hypothesis": "ch7al dyal lwe9t khasna nSawbo lfkker?" | |
| } | |
| ] | |
| } | |
| } | |
| } |