Text Generation
Transformers
PyTorch
English
Chinese
aquiladense
Mixture of Experts
conversational
custom_code
Instructions to use BAAI/AquilaDense-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BAAI/AquilaDense-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BAAI/AquilaDense-7B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("BAAI/AquilaDense-7B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BAAI/AquilaDense-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BAAI/AquilaDense-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/AquilaDense-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BAAI/AquilaDense-7B
- SGLang
How to use BAAI/AquilaDense-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/AquilaDense-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/AquilaDense-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/AquilaDense-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/AquilaDense-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BAAI/AquilaDense-7B with Docker Model Runner:
docker model run hf.co/BAAI/AquilaDense-7B
Update config.json
Browse files- config.json +7 -7
config.json
CHANGED
|
@@ -2,25 +2,25 @@
|
|
| 2 |
"architectures": [
|
| 3 |
"AquilaDenseForCausalLM"
|
| 4 |
],
|
|
|
|
| 5 |
"auto_map": {
|
| 6 |
"AutoConfig": "configuration_aquiladense.AquilaDenseConfig",
|
| 7 |
"AutoModelForCausalLM": "modeling_aquiladense.AquilaDenseForCausalLM"
|
| 8 |
},
|
| 9 |
-
"attention_dropout": 0.0,
|
| 10 |
"bos_token_id": 151849,
|
| 11 |
"eos_token_id": 151850,
|
| 12 |
"hidden_act": "silu",
|
| 13 |
-
"hidden_size":
|
| 14 |
"initializer_range": 0.02,
|
| 15 |
-
"intermediate_size":
|
| 16 |
-
"rms_norm_eps": 1e-05,
|
| 17 |
"max_position_embeddings": 4096,
|
| 18 |
"model_type": "aquiladense",
|
| 19 |
-
"num_attention_heads":
|
| 20 |
-
"num_hidden_layers":
|
| 21 |
"num_key_value_heads": 8,
|
| 22 |
"pad_token_id": 151643,
|
| 23 |
"pretraining_tp": 1,
|
|
|
|
| 24 |
"rope_scaling": null,
|
| 25 |
"rope_theta": 1000000.0,
|
| 26 |
"tie_word_embeddings": false,
|
|
@@ -29,4 +29,4 @@
|
|
| 29 |
"_attn_implementation": "flash_attention_2",
|
| 30 |
"use_cache": true,
|
| 31 |
"vocab_size": 151851
|
| 32 |
-
}
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"AquilaDenseForCausalLM"
|
| 4 |
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
"auto_map": {
|
| 7 |
"AutoConfig": "configuration_aquiladense.AquilaDenseConfig",
|
| 8 |
"AutoModelForCausalLM": "modeling_aquiladense.AquilaDenseForCausalLM"
|
| 9 |
},
|
|
|
|
| 10 |
"bos_token_id": 151849,
|
| 11 |
"eos_token_id": 151850,
|
| 12 |
"hidden_act": "silu",
|
| 13 |
+
"hidden_size": 4096,
|
| 14 |
"initializer_range": 0.02,
|
| 15 |
+
"intermediate_size": 14336,
|
|
|
|
| 16 |
"max_position_embeddings": 4096,
|
| 17 |
"model_type": "aquiladense",
|
| 18 |
+
"num_attention_heads": 32,
|
| 19 |
+
"num_hidden_layers": 32,
|
| 20 |
"num_key_value_heads": 8,
|
| 21 |
"pad_token_id": 151643,
|
| 22 |
"pretraining_tp": 1,
|
| 23 |
+
"rms_norm_eps": 1e-05,
|
| 24 |
"rope_scaling": null,
|
| 25 |
"rope_theta": 1000000.0,
|
| 26 |
"tie_word_embeddings": false,
|
|
|
|
| 29 |
"_attn_implementation": "flash_attention_2",
|
| 30 |
"use_cache": true,
|
| 31 |
"vocab_size": 151851
|
| 32 |
+
}
|