Text Generation
Transformers
Safetensors
Finnish
llama
finnish
conversational
text-generation-inference
Instructions to use Finnish-NLP/Ahma-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Finnish-NLP/Ahma-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Finnish-NLP/Ahma-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Finnish-NLP/Ahma-3B") model = AutoModelForCausalLM.from_pretrained("Finnish-NLP/Ahma-3B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Finnish-NLP/Ahma-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Finnish-NLP/Ahma-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Finnish-NLP/Ahma-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Finnish-NLP/Ahma-3B
- SGLang
How to use Finnish-NLP/Ahma-3B 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 "Finnish-NLP/Ahma-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Finnish-NLP/Ahma-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "Finnish-NLP/Ahma-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Finnish-NLP/Ahma-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Finnish-NLP/Ahma-3B with Docker Model Runner:
docker model run hf.co/Finnish-NLP/Ahma-3B
Commit History
-
Improve model card: add `library_name` and primary paper link (#2)
Verified signature- Improve model card: add `library_name` and primary paper link (7a79027f95074a72ee60eb2726260ffa999470c4) Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>f8aca06
-
Update README.md
Verified signature0b51e96
-
Update README.md
Verified signature137bf09
-
Update README.md
Verified signature7cf892c -
Update README.md
Verified signature325822d -
Update README.md
Verified signature927e8cd
-
Update README.md
Verified signature04248fc -
Add finetuning example notebooks
Verified signature607981f
-
Update README.md
Verified signature63ea4c7 -
Update README.md
Verified signaturedd9de54 -
Update README.md
Verified signature665e556 -
Update README.md
Verified signaturecd0dc30 -
Upload ahma.jpg
Verified signaturecd5d40f -
fix autotokenizer
Verified signature615b2a3
-
Add 2-stage 1060k step model
aapotce7ff6d
-
Add chat template tokenizer
Verified signature9ced1e8
-
Update optimizers
aapot0b67ff4
-
Add 900k step model
aapot916632f
-
Add 800k step model
aapota18d46e -
Add 700k step model
aapot2d16e05
-
Add 600k step model
aapot949f4bf
-
Add 500k step model
aapot359812c
-
Add 400k step model
aapot6246868
-
Add 300k step model
aapot0424dcc
-
Fix
aapot011e48d -
fix
aapot3657027
-
Update train script
aapot6db6916
-
Add new 200k model
aapote415206
-
Add 200k step model
aapotdbbddb8
-
Update README.md
Verified signature7b83030 -
Add 100k step model
aapot8085f7c
-
Update tokenizer
aapotc554f4f
-
use spm tokenizer
aapotc32a512 -
Add easylm training code
aapot5a63fc6
-
Remove HF tokenizer
aapot64db1e7
-
Add new tokenizer
aapot40e6898 -
initial commit
Verified signature8b360ea