Instructions to use DataCanvas/Alaya-7B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DataCanvas/Alaya-7B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DataCanvas/Alaya-7B-Base", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DataCanvas/Alaya-7B-Base", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("DataCanvas/Alaya-7B-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DataCanvas/Alaya-7B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DataCanvas/Alaya-7B-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DataCanvas/Alaya-7B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/DataCanvas/Alaya-7B-Base
- SGLang
How to use DataCanvas/Alaya-7B-Base 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 "DataCanvas/Alaya-7B-Base" \ --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": "DataCanvas/Alaya-7B-Base", "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 "DataCanvas/Alaya-7B-Base" \ --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": "DataCanvas/Alaya-7B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use DataCanvas/Alaya-7B-Base with Docker Model Runner:
docker model run hf.co/DataCanvas/Alaya-7B-Base
Commit ·
3bdbeb8
1
Parent(s): 9811d73
upload the model
Browse files- adapt_tokenizer.py +0 -0
- attention.py +0 -0
- blocks.py +0 -0
- config.json +0 -0
- custom_embedding.py +0 -0
- fc.py +0 -0
- ffn.py +0 -0
- flash_attn_triton.py +0 -0
- generation_config.json +0 -0
- hf_prefixlm_converter.py +0 -0
- meta_init_context.py +0 -0
- norm.py +0 -0
- param_init_fns.py +0 -0
- pytorch_model-00001-of-00002.bin +1 -1
- pytorch_model-00002-of-00002.bin +1 -1
- pytorch_model.bin +1 -1
adapt_tokenizer.py
CHANGED
|
File without changes
|
attention.py
CHANGED
|
File without changes
|
blocks.py
CHANGED
|
File without changes
|
config.json
CHANGED
|
File without changes
|
custom_embedding.py
CHANGED
|
File without changes
|
fc.py
CHANGED
|
File without changes
|
ffn.py
CHANGED
|
File without changes
|
flash_attn_triton.py
CHANGED
|
File without changes
|
generation_config.json
CHANGED
|
File without changes
|
hf_prefixlm_converter.py
CHANGED
|
File without changes
|
meta_init_context.py
CHANGED
|
File without changes
|
norm.py
CHANGED
|
File without changes
|
param_init_fns.py
CHANGED
|
File without changes
|
pytorch_model-00001-of-00002.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 9890684145
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ccb72f40e9c76b0e4e62da3040bf1e4027e9c61aae51893680ac93e2a3a75c81
|
| 3 |
size 9890684145
|
pytorch_model-00002-of-00002.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3490604568
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:49744a4fcc062c56f14109494e6be85cac05787ee3d5e21bf218fec505a91064
|
| 3 |
size 3490604568
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 13381339494
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:03044442a39cfed07417f8a21601ada32f3f85320f21600e383adbc134987c58
|
| 3 |
size 13381339494
|