Instructions to use adityaedy01/llama3-somali1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use adityaedy01/llama3-somali1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="adityaedy01/llama3-somali1")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("adityaedy01/llama3-somali1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use adityaedy01/llama3-somali1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "adityaedy01/llama3-somali1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "adityaedy01/llama3-somali1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/adityaedy01/llama3-somali1
- SGLang
How to use adityaedy01/llama3-somali1 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 "adityaedy01/llama3-somali1" \ --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": "adityaedy01/llama3-somali1", "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 "adityaedy01/llama3-somali1" \ --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": "adityaedy01/llama3-somali1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use adityaedy01/llama3-somali1 with Docker Model Runner:
docker model run hf.co/adityaedy01/llama3-somali1
How can i run this model?
Could you please guide me through running this? I’m new to Unsloth, so I’d appreciate it if you could explain the process. Also, if you could share the data you used for training and the accuracy achieved, that would be very helpful. Thanks!
found out you can run it like this but it is somali doesnt make sanse
"from unsloth import FastLanguageModel
max_seq_len = 1024
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="adityaedy01/llama3-somali1",
max_seq_length=max_seq_len,
dtype=None
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
prompt_tempate = """Hoos waxaa ku qoran tilmaamo sharxaya hawl, oo lagu lammaaneeyay wax gelin siiya macluumaad dheeraad ah. Qor jawaab si habboon u dhamaystiraysa codsiga.
Tilmaamo:
{}
Wax gelin:
{}
Jawaab:
"""
def generate_output(instruction, user_input):
input_ids = tokenizer(
[
prompt_tempate.format(instruction, user_input)
], return_tensors="pt").to("cuda")
outputs = model.generate(**input_ids, max_length=max_seq_len, do_sample=True)
# removes prompt, comment this out if you want to see it.
outputs = [output[len(input_ids[i].ids):] for i, output in enumerate(outputs)]
return tokenizer.decode(outputs[0], skip_special_tokens=True)
response = generate_output("Maxaa aad u samayn kartaa?", "")
print(response)"