Instructions to use Nelathan/AFM-4.5B-rooted with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nelathan/AFM-4.5B-rooted with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nelathan/AFM-4.5B-rooted") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nelathan/AFM-4.5B-rooted") model = AutoModelForCausalLM.from_pretrained("Nelathan/AFM-4.5B-rooted", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nelathan/AFM-4.5B-rooted with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nelathan/AFM-4.5B-rooted" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nelathan/AFM-4.5B-rooted", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nelathan/AFM-4.5B-rooted
- SGLang
How to use Nelathan/AFM-4.5B-rooted 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 "Nelathan/AFM-4.5B-rooted" \ --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": "Nelathan/AFM-4.5B-rooted", "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 "Nelathan/AFM-4.5B-rooted" \ --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": "Nelathan/AFM-4.5B-rooted", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nelathan/AFM-4.5B-rooted with Docker Model Runner:
docker model run hf.co/Nelathan/AFM-4.5B-rooted
Upload folder using huggingface_hub
Browse files- config.json +3 -5
config.json
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"architectures": [
|
| 3 |
-
"ArceeForCausalLM"
|
| 4 |
-
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 128000,
|
|
@@ -17,7 +15,7 @@
|
|
| 17 |
"num_attention_heads": 20,
|
| 18 |
"num_hidden_layers": 36,
|
| 19 |
"num_key_value_heads": 4,
|
| 20 |
-
"rms_norm_eps": 1e-
|
| 21 |
"rope_scaling": {
|
| 22 |
"beta_fast": 32.0,
|
| 23 |
"beta_slow": 1.0,
|
|
@@ -32,5 +30,5 @@
|
|
| 32 |
"torch_dtype": "bfloat16",
|
| 33 |
"transformers_version": "4.54.1",
|
| 34 |
"use_cache": false,
|
| 35 |
-
"vocab_size":
|
| 36 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"architectures": ["ArceeForCausalLM"],
|
|
|
|
|
|
|
| 3 |
"attention_bias": false,
|
| 4 |
"attention_dropout": 0.0,
|
| 5 |
"bos_token_id": 128000,
|
|
|
|
| 15 |
"num_attention_heads": 20,
|
| 16 |
"num_hidden_layers": 36,
|
| 17 |
"num_key_value_heads": 4,
|
| 18 |
+
"rms_norm_eps": 1e-5,
|
| 19 |
"rope_scaling": {
|
| 20 |
"beta_fast": 32.0,
|
| 21 |
"beta_slow": 1.0,
|
|
|
|
| 30 |
"torch_dtype": "bfloat16",
|
| 31 |
"transformers_version": "4.54.1",
|
| 32 |
"use_cache": false,
|
| 33 |
+
"vocab_size": 128004
|
| 34 |
}
|