Instructions to use BAAI/Aquila2-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BAAI/Aquila2-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BAAI/Aquila2-7B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("BAAI/Aquila2-7B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BAAI/Aquila2-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BAAI/Aquila2-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BAAI/Aquila2-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BAAI/Aquila2-7B
- SGLang
How to use BAAI/Aquila2-7B 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 "BAAI/Aquila2-7B" \ --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": "BAAI/Aquila2-7B", "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 "BAAI/Aquila2-7B" \ --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": "BAAI/Aquila2-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BAAI/Aquila2-7B with Docker Model Runner:
docker model run hf.co/BAAI/Aquila2-7B
Commit History
-
Update README.md
Verified signaturee7d475d
-
Update README_zh.md
Verified signaturea8a0414 -
Update README.md
Verified signature85c3ed1 -
Delete base_metrics_CN.jpeg
Verified signature9a9a218 -
Delete base_metrics.jpeg
Verified signature8963f89 -
Update README_zh.md
Verified signature49c3257 -
Update README.md
Verified signaturec8c9fef
-
Delete pytorch_model.bin.index.json
Verified signaturecb7427f -
Delete vocab.json
Verified signature38c11d1 -
Delete merges.txt
Verified signature2f80f43 -
Upload tokenizer_config.json with huggingface_hub
Verified signature35497ba -
Upload tokenizer.json with huggingface_hub
Verified signature7868b09 -
Upload special_tokens_map.json with huggingface_hub
Verified signatureceb39be -
Upload modeling_aquila.py with huggingface_hub
Verified signaturebb9204d -
Upload model.safetensors.index.json with huggingface_hub
Verified signature9b36856 -
Upload model-00007-of-00007.safetensors with huggingface_hub
Verified signature32dd458 -
Upload model-00006-of-00007.safetensors with huggingface_hub
Verified signaturec061529 -
Delete pytorch_model.bin
Verified signature3e2fb67 -
Delete pytorch_model-00002-of-00002.bin
Verified signature9793891 -
Delete pytorch_model-00001-of-00002.bin
Verified signatureb00ae5d -
Upload model-00005-of-00007.safetensors with huggingface_hub
Verified signature2846094 -
Upload model-00004-of-00007.safetensors with huggingface_hub
Verified signaturee462f81 -
Upload model-00003-of-00007.safetensors with huggingface_hub
Verified signature5b3b6fd -
Upload model-00002-of-00007.safetensors with huggingface_hub
Verified signaturec96a47b -
Upload model-00001-of-00007.safetensors with huggingface_hub
Verified signature60e4910 -
Upload generation_config.json with huggingface_hub
Verified signature648d349 -
Upload configuration_aquila.py with huggingface_hub
Verified signature1a8c91f -
Upload config.json with huggingface_hub
Verified signature6cf695c
-
Delete trainer_state.json
9c76e14
-
Update tokenizer_config.json
f563a9e
-
Update README.md
d6cf52d
-
Upload pytorch_model.bin
4fe88f4 -
Update README_zh.md
4b6473f -
Upload 2 files
6e7d953
-
Update README_zh.md
8045fd7 -
Update README.md
347d85c -
Update README_zh.md
beede7b -
Update README.md
db57085 -
Update README.md
6cbc624 -
Update README_zh.md
3505144 -
Update README.md
6d29ec4 -
Update README.md
d77378d -
Update README.md
411d60d -
Update README_zh.md
3a1c227 -
Update README_zh.md
6a0cae0 -
Update README_zh.md
567dbfb -
Update README_zh.md
4a727fc -
Update README_zh.md
5a0d249 -
Update README.md
c2b9932 -
Upload BAAI-Aquila-Model-License -Agreement.pdf
9990686