Instructions to use cloudyu/Mixtral_13B_Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cloudyu/Mixtral_13B_Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cloudyu/Mixtral_13B_Chat")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cloudyu/Mixtral_13B_Chat") model = AutoModelForCausalLM.from_pretrained("cloudyu/Mixtral_13B_Chat") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use cloudyu/Mixtral_13B_Chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cloudyu/Mixtral_13B_Chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cloudyu/Mixtral_13B_Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cloudyu/Mixtral_13B_Chat
- SGLang
How to use cloudyu/Mixtral_13B_Chat 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 "cloudyu/Mixtral_13B_Chat" \ --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": "cloudyu/Mixtral_13B_Chat", "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 "cloudyu/Mixtral_13B_Chat" \ --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": "cloudyu/Mixtral_13B_Chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cloudyu/Mixtral_13B_Chat with Docker Model Runner:
docker model run hf.co/cloudyu/Mixtral_13B_Chat
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
This is a fine-tuned 13B chat model
|
| 6 |
+
|
| 7 |
+
code example
|
| 8 |
+
```
|
| 9 |
+
import torch
|
| 10 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 11 |
+
import math
|
| 12 |
+
|
| 13 |
+
## v2 models
|
| 14 |
+
model_path = "cloudyu/Mixtral_13B_Chat"
|
| 15 |
+
|
| 16 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path, use_default_system_prompt=False)
|
| 17 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 18 |
+
model_path, torch_dtype=torch.bfloat16, device_map='auto',local_files_only=False, load_in_4bit=True
|
| 19 |
+
)
|
| 20 |
+
print(model)
|
| 21 |
+
prompt = input("please input prompt:")
|
| 22 |
+
while len(prompt) > 0:
|
| 23 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to("cuda")
|
| 24 |
+
|
| 25 |
+
generation_output = model.generate(
|
| 26 |
+
input_ids=input_ids, max_new_tokens=800,repetition_penalty=1.2
|
| 27 |
+
)
|
| 28 |
+
print(tokenizer.decode(generation_output[0]))
|
| 29 |
+
prompt = input("please input prompt:")
|
| 30 |
+
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
output examples
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
<s> 12+13-24=?
|
| 37 |
+
To solve this equation, we need to follow the order of operations (PEMDAS/BODMAS): Parentheses, Exponents, Multiplication and Division (from left to right), Addition and Subtraction (from left to right).
|
| 38 |
+
|
| 39 |
+
Given expression: 12 + 13 - 24
|
| 40 |
+
First, let's add 12 and 13 together:
|
| 41 |
+
12 + 13 = 25
|
| 42 |
+
Now our expression looks like this: 25 - 24
|
| 43 |
+
Next, subtract 24 from 25:
|
| 44 |
+
25 - 24 = 1
|
| 45 |
+
So, the final answer is 1.</s>
|
| 46 |
+
```
|