Instructions to use leon-se/Aria-sequential_mlp-FP8-dynamic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use leon-se/Aria-sequential_mlp-FP8-dynamic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="leon-se/Aria-sequential_mlp-FP8-dynamic", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("leon-se/Aria-sequential_mlp-FP8-dynamic", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("leon-se/Aria-sequential_mlp-FP8-dynamic", trust_remote_code=True, device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use leon-se/Aria-sequential_mlp-FP8-dynamic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "leon-se/Aria-sequential_mlp-FP8-dynamic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "leon-se/Aria-sequential_mlp-FP8-dynamic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/leon-se/Aria-sequential_mlp-FP8-dynamic
- SGLang
How to use leon-se/Aria-sequential_mlp-FP8-dynamic 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 "leon-se/Aria-sequential_mlp-FP8-dynamic" \ --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": "leon-se/Aria-sequential_mlp-FP8-dynamic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "leon-se/Aria-sequential_mlp-FP8-dynamic" \ --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": "leon-se/Aria-sequential_mlp-FP8-dynamic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use leon-se/Aria-sequential_mlp-FP8-dynamic with Docker Model Runner:
docker model run hf.co/leon-se/Aria-sequential_mlp-FP8-dynamic
Leon commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -4,10 +4,11 @@ base_model:
|
|
| 4 |
- rhymes-ai/Aria-sequential_mlp
|
| 5 |
- rhymes-ai/Aria
|
| 6 |
pipeline_tag: image-text-to-text
|
|
|
|
| 7 |
---
|
| 8 |
# Aria-sequential_mlp-FP8-dynamic
|
| 9 |
-
FP8-Dynamic quantization from [Aria-sequential_mlp](https://huggingface.co/rhymes-ai/Aria-sequential_mlp) made with [llm-compressor](https://github.com/vllm-project/llm-compressor), requires about
|
| 10 |
-
###
|
| 11 |
```
|
| 12 |
pip install transformers==4.45.0 accelerate==0.34.1 sentencepiece==0.2.0 torchvision requests torch Pillow compressed-tensors
|
| 13 |
pip install flash-attn --no-build-isolation
|
|
@@ -24,7 +25,7 @@ torch.cuda.set_device(0)
|
|
| 24 |
|
| 25 |
model_id_or_path = "thwin27/Aria-sequential_mlp-bnb_FP8-dynamic"
|
| 26 |
|
| 27 |
-
model = AutoModelForCausalLM.from_pretrained(model_id_or_path, torch_dtype=torch.bfloat16, trust_remote_code=True)
|
| 28 |
processor = AutoProcessor.from_pretrained(model_id_or_path, trust_remote_code=True)
|
| 29 |
|
| 30 |
image_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png"
|
|
|
|
| 4 |
- rhymes-ai/Aria-sequential_mlp
|
| 5 |
- rhymes-ai/Aria
|
| 6 |
pipeline_tag: image-text-to-text
|
| 7 |
+
library_name: transformers
|
| 8 |
---
|
| 9 |
# Aria-sequential_mlp-FP8-dynamic
|
| 10 |
+
FP8-Dynamic quantization from [Aria-sequential_mlp](https://huggingface.co/rhymes-ai/Aria-sequential_mlp) made with [llm-compressor](https://github.com/vllm-project/llm-compressor), requires about 24.8 GB of VRAM.
|
| 11 |
+
### Installationcompressed-tensors
|
| 12 |
```
|
| 13 |
pip install transformers==4.45.0 accelerate==0.34.1 sentencepiece==0.2.0 torchvision requests torch Pillow compressed-tensors
|
| 14 |
pip install flash-attn --no-build-isolation
|
|
|
|
| 25 |
|
| 26 |
model_id_or_path = "thwin27/Aria-sequential_mlp-bnb_FP8-dynamic"
|
| 27 |
|
| 28 |
+
model = AutoModelForCausalLM.from_pretrained(model_id_or_path, device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
|
| 29 |
processor = AutoProcessor.from_pretrained(model_id_or_path, trust_remote_code=True)
|
| 30 |
|
| 31 |
image_path = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png"
|