Text Generation
Transformers
Safetensors
llama
flashnorm
transformer-tricks
efficient-inference
weightless-rmsnorm
text-generation-inference
Instructions to use open-machine/Llama-3.2-1B-FlashNorm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use open-machine/Llama-3.2-1B-FlashNorm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="open-machine/Llama-3.2-1B-FlashNorm")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("open-machine/Llama-3.2-1B-FlashNorm") model = AutoModelForCausalLM.from_pretrained("open-machine/Llama-3.2-1B-FlashNorm") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use open-machine/Llama-3.2-1B-FlashNorm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "open-machine/Llama-3.2-1B-FlashNorm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "open-machine/Llama-3.2-1B-FlashNorm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/open-machine/Llama-3.2-1B-FlashNorm
- SGLang
How to use open-machine/Llama-3.2-1B-FlashNorm 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 "open-machine/Llama-3.2-1B-FlashNorm" \ --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": "open-machine/Llama-3.2-1B-FlashNorm", "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 "open-machine/Llama-3.2-1B-FlashNorm" \ --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": "open-machine/Llama-3.2-1B-FlashNorm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use open-machine/Llama-3.2-1B-FlashNorm with Docker Model Runner:
docker model run hf.co/open-machine/Llama-3.2-1B-FlashNorm
Add library_name and update model card
Browse filesThis PR adds `library_name: transformers` to the YAML metadata to enable the library's automated code snippets on the hub. It also includes a link to the paper [FlashNorm: Fast Normalization for Transformers](https://huggingface.co/papers/2407.09577) in the model description.
README.md
CHANGED
|
@@ -1,17 +1,20 @@
|
|
| 1 |
---
|
| 2 |
-
license: llama3.2
|
| 3 |
base_model: meta-llama/Llama-3.2-1B
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
- transformer-tricks
|
| 7 |
-
- efficient-inference
|
| 8 |
-
- weightless-rmsnorm
|
| 9 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
# Llama-3.2-1B-FlashNorm
|
| 13 |
|
| 14 |
-
FlashNorm-prepared checkpoint of [meta-llama/Llama-3.2-1B](https://huggingface.co/meta-llama/Llama-3.2-1B).
|
|
|
|
|
|
|
| 15 |
|
| 16 |
> **Framework support note.** Stock vLLM currently does not load this checkpoint because the norm weight tensors are absent. The upstream patch to accept missing tensors is tracked at: **TBD (vLLM issue link)**. Until the patch lands, use HuggingFace Transformers; it loads this with a warning that norm weights were not initialized and defaults them to ones, which is the correct behavior for FlashNorm.
|
| 17 |
|
|
@@ -55,4 +58,4 @@ Not yet supported. See the tracking issue linked above.
|
|
| 55 |
|
| 56 |
## License
|
| 57 |
|
| 58 |
-
Inherited from the source model.
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
base_model: meta-llama/Llama-3.2-1B
|
| 3 |
+
library_name: transformers
|
| 4 |
+
license: llama3.2
|
|
|
|
|
|
|
|
|
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- flashnorm
|
| 8 |
+
- transformer-tricks
|
| 9 |
+
- efficient-inference
|
| 10 |
+
- weightless-rmsnorm
|
| 11 |
---
|
| 12 |
|
| 13 |
# Llama-3.2-1B-FlashNorm
|
| 14 |
|
| 15 |
+
FlashNorm-prepared checkpoint of [meta-llama/Llama-3.2-1B](https://huggingface.co/meta-llama/Llama-3.2-1B). This model was presented in the paper [FlashNorm: Fast Normalization for Transformers](https://huggingface.co/papers/2407.09577).
|
| 16 |
+
|
| 17 |
+
Mathematically equivalent to the source model. The per-channel RMSNorm weight tensors (`input_layernorm.weight`, `post_attention_layernorm.weight`, `model.norm.weight`) are folded into the following linear layers and then removed from the state dict entirely.
|
| 18 |
|
| 19 |
> **Framework support note.** Stock vLLM currently does not load this checkpoint because the norm weight tensors are absent. The upstream patch to accept missing tensors is tracked at: **TBD (vLLM issue link)**. Until the patch lands, use HuggingFace Transformers; it loads this with a warning that norm weights were not initialized and defaults them to ones, which is the correct behavior for FlashNorm.
|
| 20 |
|
|
|
|
| 58 |
|
| 59 |
## License
|
| 60 |
|
| 61 |
+
Inherited from the source model.
|