Instructions to use project-baize/baize-v2-13b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use project-baize/baize-v2-13b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="project-baize/baize-v2-13b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("project-baize/baize-v2-13b") model = AutoModelForCausalLM.from_pretrained("project-baize/baize-v2-13b") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use project-baize/baize-v2-13b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "project-baize/baize-v2-13b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "project-baize/baize-v2-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/project-baize/baize-v2-13b
- SGLang
How to use project-baize/baize-v2-13b 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 "project-baize/baize-v2-13b" \ --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": "project-baize/baize-v2-13b", "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 "project-baize/baize-v2-13b" \ --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": "project-baize/baize-v2-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use project-baize/baize-v2-13b with Docker Model Runner:
docker model run hf.co/project-baize/baize-v2-13b
Commit ·
a99eb61
1
Parent(s): 5b98346
Update README.md
Browse files
README.md
CHANGED
|
@@ -6,6 +6,13 @@ license: cc-by-nc-4.0
|
|
| 6 |
</p>
|
| 7 |
<hr>
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
## Demo
|
| 10 |
https://huggingface.co/spaces/project-baize/chat-with-baize
|
| 11 |
|
|
|
|
| 6 |
</p>
|
| 7 |
<hr>
|
| 8 |
|
| 9 |
+
## ⚠️Warning
|
| 10 |
+
Using Baize checkpoints directly without the following format will not work.
|
| 11 |
+
```
|
| 12 |
+
The following is a conversation between a human and an AI assistant named Baize (named after a mythical creature in Chinese folklore). Baize is an open-source AI assistant developed by UCSD and Sun Yat-Sen University. The human and the AI assistant take turns chatting. Human statements start with [|Human|] and AI assistant statements start with [|AI|]. The AI assistant always provides responses in as much detail as possible, and in Markdown format. The AI assistant always declines to engage with topics, questions and instructions related to unethical, controversial, or sensitive issues. Complete the transcript in exactly that format.\n[|Human|]Hello!\n[|AI|]Hi!
|
| 13 |
+
```
|
| 14 |
+
`[|Human|]` and `[|AI|]` are required to mark the messages from the user and Baize. We recommend checking out our [GitHub](https://github.com/project-baize/baize) to find the best way to use Baize with our demo or Fastchat.
|
| 15 |
+
|
| 16 |
## Demo
|
| 17 |
https://huggingface.co/spaces/project-baize/chat-with-baize
|
| 18 |
|