Instructions to use RedHatAI/MiniChat-3B-pruned50-quant-ds with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/MiniChat-3B-pruned50-quant-ds with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/MiniChat-3B-pruned50-quant-ds")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RedHatAI/MiniChat-3B-pruned50-quant-ds") model = AutoModelForCausalLM.from_pretrained("RedHatAI/MiniChat-3B-pruned50-quant-ds", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RedHatAI/MiniChat-3B-pruned50-quant-ds with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/MiniChat-3B-pruned50-quant-ds" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/MiniChat-3B-pruned50-quant-ds", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/RedHatAI/MiniChat-3B-pruned50-quant-ds
- SGLang
How to use RedHatAI/MiniChat-3B-pruned50-quant-ds 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 "RedHatAI/MiniChat-3B-pruned50-quant-ds" \ --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": "RedHatAI/MiniChat-3B-pruned50-quant-ds", "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 "RedHatAI/MiniChat-3B-pruned50-quant-ds" \ --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": "RedHatAI/MiniChat-3B-pruned50-quant-ds", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use RedHatAI/MiniChat-3B-pruned50-quant-ds with Docker Model Runner:
docker model run hf.co/RedHatAI/MiniChat-3B-pruned50-quant-ds
Commit ·
ba6cc08
1
Parent(s): a76181a
Update README.md
Browse files
README.md
CHANGED
|
@@ -6,18 +6,21 @@ tags:
|
|
| 6 |
|
| 7 |
```python
|
| 8 |
from deepsparse import TextGeneration
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
model = TextGeneration(model="deployment")
|
| 10 |
-
|
|
|
|
| 11 |
"""
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
8. Let the bread cool and then slice it into individual slices.
|
| 20 |
-
9.
|
| 21 |
"""
|
| 22 |
```
|
| 23 |
## One-shot and Export
|
|
|
|
| 6 |
|
| 7 |
```python
|
| 8 |
from deepsparse import TextGeneration
|
| 9 |
+
|
| 10 |
+
prompt = "How to get in a good university?"
|
| 11 |
+
formatted_prompt = f"<s> [|User|]\n{prompt}</s>[|Assistant|]\n"
|
| 12 |
+
|
| 13 |
model = TextGeneration(model="deployment")
|
| 14 |
+
|
| 15 |
+
print(model(formatted_prompt, max_new_tokens=500).generations[0].text)
|
| 16 |
"""
|
| 17 |
+
Hi there! I'm an AI assistant and I can help you with any questions you have. Here's how you can get into a good university:
|
| 18 |
+
1. Choose a university that you are interested in.
|
| 19 |
+
2. Read the university's website and learn more about their programs and courses.
|
| 20 |
+
3. Reach out to the university's alumni or staff members and ask for advice or guidance.
|
| 21 |
+
4. Attend a campus tour or visit day to get a better understanding of the university's culture and atmosphere.
|
| 22 |
+
5. Finally, don't wait to apply for the university of your choice.
|
| 23 |
+
I hope this helps you get into a good university! Let me know if you have any other questions or need any more information.
|
|
|
|
|
|
|
| 24 |
"""
|
| 25 |
```
|
| 26 |
## One-shot and Export
|