Instructions to use arcee-ai/AFM-4.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use arcee-ai/AFM-4.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="arcee-ai/AFM-4.5B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("arcee-ai/AFM-4.5B") model = AutoModelForCausalLM.from_pretrained("arcee-ai/AFM-4.5B") 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
- vLLM
How to use arcee-ai/AFM-4.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "arcee-ai/AFM-4.5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "arcee-ai/AFM-4.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/arcee-ai/AFM-4.5B
- SGLang
How to use arcee-ai/AFM-4.5B 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 "arcee-ai/AFM-4.5B" \ --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": "arcee-ai/AFM-4.5B", "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 "arcee-ai/AFM-4.5B" \ --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": "arcee-ai/AFM-4.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use arcee-ai/AFM-4.5B with Docker Model Runner:
docker model run hf.co/arcee-ai/AFM-4.5B
Update README.md
#2
by Crystalcareai - opened
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
| 3 |
license_name: aml
|
| 4 |
language:
|
| 5 |
- en
|
|
@@ -15,9 +15,6 @@ language:
|
|
| 15 |
- zh
|
| 16 |
library_name: transformers
|
| 17 |
extra_gated_prompt: Company name is optional, please put NA if you would prefer not to share it.
|
| 18 |
-
extra_gated_fields:
|
| 19 |
-
Company: text
|
| 20 |
-
I agree to use this model in accordance with the Arcee Model License (AML): checkbox
|
| 21 |
base_model:
|
| 22 |
- arcee-ai/AFM-4.5B-Base
|
| 23 |
---
|
|
@@ -54,7 +51,6 @@ View our documentation here for more details: https://docs.arcee.ai/arcee-founda
|
|
| 54 |
* **Model Architecture:** ArceeForCausalLM
|
| 55 |
* **Parameters:** 4.5B
|
| 56 |
* **Training Tokens:**
|
| 57 |
-
* **License:** [Arcee Model License (AML)](https://huggingface.co/arcee-ai/AFM-4.5B#license)
|
| 58 |
* **Recommended settings:**
|
| 59 |
* temperature: 0.5
|
| 60 |
* top_k: 50
|
|
@@ -173,6 +169,4 @@ https://huggingface.co/arcee-ai/AFM-4.5B-ov
|
|
| 173 |
|
| 174 |
## License
|
| 175 |
|
| 176 |
-
AFM-4.5B is released under the
|
| 177 |
-
|
| 178 |
-
We want as many developers, researchers, and builders as possible to benefit from AFM-4.5B. At the same time, this license ensures that we can continue to develop and support the model for the community.
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
license_name: aml
|
| 4 |
language:
|
| 5 |
- en
|
|
|
|
| 15 |
- zh
|
| 16 |
library_name: transformers
|
| 17 |
extra_gated_prompt: Company name is optional, please put NA if you would prefer not to share it.
|
|
|
|
|
|
|
|
|
|
| 18 |
base_model:
|
| 19 |
- arcee-ai/AFM-4.5B-Base
|
| 20 |
---
|
|
|
|
| 51 |
* **Model Architecture:** ArceeForCausalLM
|
| 52 |
* **Parameters:** 4.5B
|
| 53 |
* **Training Tokens:**
|
|
|
|
| 54 |
* **Recommended settings:**
|
| 55 |
* temperature: 0.5
|
| 56 |
* top_k: 50
|
|
|
|
| 169 |
|
| 170 |
## License
|
| 171 |
|
| 172 |
+
AFM-4.5B is released under the Apache-2.0 license.
|
|
|
|
|
|