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 ·
5807bb9
1
Parent(s): e356521
Update README.md
Browse files
README.md
CHANGED
|
@@ -19,7 +19,25 @@ This can be done by setting realistic goals and targets, regularly reviewing you
|
|
| 19 |
Additionally, participating in extracurricular activities and building a network of friends can also help in getting into a good university.
|
| 20 |
"""
|
| 21 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
## One-shot and Export
|
| 24 |
|
| 25 |
```bash
|
|
|
|
| 19 |
Additionally, participating in extracurricular activities and building a network of friends can also help in getting into a good university.
|
| 20 |
"""
|
| 21 |
```
|
| 22 |
+
```python
|
| 23 |
+
from deepsparse import TextGeneration
|
| 24 |
+
|
| 25 |
+
prompt = "How to become a great software engineer?"
|
| 26 |
+
formatted_prompt = f"<s> [|User|]\n{prompt}</s>[|Assistant|]\n"
|
| 27 |
+
|
| 28 |
+
model = TextGeneration(model="hf:nm-testing/MiniChat-3B-pruned-quant-50")
|
| 29 |
|
| 30 |
+
print(model(formatted_prompt, max_new_tokens=500).generations[0].text)
|
| 31 |
+
"""
|
| 32 |
+
To become a great software engineer, you need to have a strong foundation in computer science and programming. Here are some tips to help you become a great software engineer:
|
| 33 |
+
1. Learn a programming language: You need to learn at least one programming language that you can use to develop software applications. Some popular programming languages include Python, Java, and C++.
|
| 34 |
+
2. Learn about data structures and algorithms: You need to learn about data structures and algorithms that you can use to develop software applications. You can learn about data structures like arrays, linked lists, and trees, and algorithms like sorting algorithms and dynamic programming.
|
| 35 |
+
3. Practice your skills: You need to practice your skills in programming and data structures to become proficient in your chosen programming language. You can practice by working on open-source projects or contributing to open-source projects.
|
| 36 |
+
4. Keep up to date: You need to keep up to date with new technologies and programming languages to stay relevant in the field. You can keep up to date by reading blogs, attending meetups, and participating in online communities.
|
| 37 |
+
5. Collaborate with others: You can collaborate with others to develop software applications that can benefit society. You can collaborate with others by participating in open-source projects, contributing to open-source communities, and sharing knowledge with others.
|
| 38 |
+
By following these tips, you can become a great software engineer and develop software applications that can benefit society.
|
| 39 |
+
"""
|
| 40 |
+
```
|
| 41 |
## One-shot and Export
|
| 42 |
|
| 43 |
```bash
|