Instructions to use iko-01/marocknewAI1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use iko-01/marocknewAI1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="iko-01/marocknewAI1")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("iko-01/marocknewAI1") model = AutoModelForCausalLM.from_pretrained("iko-01/marocknewAI1") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use iko-01/marocknewAI1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "iko-01/marocknewAI1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iko-01/marocknewAI1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/iko-01/marocknewAI1
- SGLang
How to use iko-01/marocknewAI1 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 "iko-01/marocknewAI1" \ --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": "iko-01/marocknewAI1", "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 "iko-01/marocknewAI1" \ --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": "iko-01/marocknewAI1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use iko-01/marocknewAI1 with Docker Model Runner:
docker model run hf.co/iko-01/marocknewAI1
HOW TO USE IT :
TEST_PROMPTS = [
"ุงุดูู ูู ุงูุฐูุงุก ุงูุงุตุทูุงุนู (AI) ุจุตูุฉ ุนุงู
ุฉุ",
# U CAN ADD MORE Q in darija moroccain !
def generate_answer(prompt, max_new_tokens=150):
full_prompt = f"Question: {prompt}\nAnswer:\n"
out = pipe(full_prompt, max_new_tokens=max_new_tokens, do_sample=False)[0]['generated_text']
if out.startswith(full_prompt):
generated = out[len(full_prompt):]
else:
generated = out.split('Answer:')[-1]
if '\n\n' in generated:
generated = generated.split('\n\n')[0].strip()
return generated.strip()
results = {p: generate_answer(p) for p in TEST_PROMPTS}
html_blocks = []
for q,a in results.items():
html_blocks.append(f"<h3>Question:</h3><p>{q}</p><h3>Answer:</h3><p class='ans'>{a.replace('\n','<br/>')}</p><hr/>")
html = """
<div>
<button onclick="var els=document.getElementsByClassName('ans'); for(var i=0;i<els.length;i++){els[i].style.fontSize=(parseInt(window.getComputedStyle(els[i]).fontSize)+4)+'px'}">A+ (increase)</button>
<button onclick="var els=document.getElementsByClassName('ans'); for(var i=0;i<els.length;i++){els[i].style.fontSize=(parseInt(window.getComputedStyle(els[i]).fontSize)-4)+'px'}">A- (decrease)</button>
<div style='margin-top:10px'>{content}</div>
</div>
""".replace('{content}', ''.join(html_blocks))
print(html)
- this is bad model witch Eval loss: 1.7146, Perplexity: 5.55
- Downloads last month
- 2
Model tree for iko-01/marocknewAI1
Base model
iko-01/marocAI