Instructions to use sammysun0711/aquilachat-7b-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sammysun0711/aquilachat-7b-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sammysun0711/aquilachat-7b-hf", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sammysun0711/aquilachat-7b-hf", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("sammysun0711/aquilachat-7b-hf", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sammysun0711/aquilachat-7b-hf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sammysun0711/aquilachat-7b-hf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sammysun0711/aquilachat-7b-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sammysun0711/aquilachat-7b-hf
- SGLang
How to use sammysun0711/aquilachat-7b-hf 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 "sammysun0711/aquilachat-7b-hf" \ --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": "sammysun0711/aquilachat-7b-hf", "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 "sammysun0711/aquilachat-7b-hf" \ --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": "sammysun0711/aquilachat-7b-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sammysun0711/aquilachat-7b-hf with Docker Model Runner:
docker model run hf.co/sammysun0711/aquilachat-7b-hf
Commit ·
720543f
1
Parent(s): 4e0f1d3
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,12 +8,12 @@ https://github.com/FlagAI-Open/FlagAI/tree/master/examples/Aquila/Aquila-chat
|
|
| 8 |
|
| 9 |
Support Inference with AutoModelForCausalLM, ORTModelForCausalLM and OVModelForCausalLM
|
| 10 |
```python
|
| 11 |
-
#!pip install transformers>=4.
|
| 12 |
-
#!pip install optimum>=1.8.
|
| 13 |
import torch
|
| 14 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 15 |
|
| 16 |
-
tokenizer = AutoTokenizer.from_pretrained('sammysun0711/aquilachat-7b-hf')
|
| 17 |
model = AutoModelForCausalLM.from_pretrained('sammysun0711/aquilachat-7b-hf', trust_remote_code=True)
|
| 18 |
model = model.eval()
|
| 19 |
# from optimum.onnxruntime import ORTModelForCausalLM
|
|
|
|
| 8 |
|
| 9 |
Support Inference with AutoModelForCausalLM, ORTModelForCausalLM and OVModelForCausalLM
|
| 10 |
```python
|
| 11 |
+
#!pip install transformers>=4.30.2
|
| 12 |
+
#!pip install optimum>=1.8.8 optimum-intel[openvino]==1.9.1
|
| 13 |
import torch
|
| 14 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 15 |
|
| 16 |
+
tokenizer = AutoTokenizer.from_pretrained('sammysun0711/aquilachat-7b-hf', trust_remote_code=True)
|
| 17 |
model = AutoModelForCausalLM.from_pretrained('sammysun0711/aquilachat-7b-hf', trust_remote_code=True)
|
| 18 |
model = model.eval()
|
| 19 |
# from optimum.onnxruntime import ORTModelForCausalLM
|