Text Generation
Transformers
Safetensors
English
llama
codepy
ollama
llama-cpp
trl
deep-think
coder
conversational
text-generation-inference
Instructions to use prithivMLmods/Codepy-Deepthink-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Codepy-Deepthink-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/Codepy-Deepthink-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/Codepy-Deepthink-3B") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/Codepy-Deepthink-3B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/Codepy-Deepthink-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Codepy-Deepthink-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Codepy-Deepthink-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/Codepy-Deepthink-3B
- SGLang
How to use prithivMLmods/Codepy-Deepthink-3B 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 "prithivMLmods/Codepy-Deepthink-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Codepy-Deepthink-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "prithivMLmods/Codepy-Deepthink-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Codepy-Deepthink-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/Codepy-Deepthink-3B with Docker Model Runner:
docker model run hf.co/prithivMLmods/Codepy-Deepthink-3B
Update README.md
Browse files
README.md
CHANGED
|
@@ -147,3 +147,57 @@ To customize the password length, modify the `password_length` variable in the s
|
|
| 147 |
|
| 148 |
Llama 3.2 is an auto-regressive language model that uses an optimized transformer architecture. The tuned versions use supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to align with human preferences for helpfulness and safety.
|
| 149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
Llama 3.2 is an auto-regressive language model that uses an optimized transformer architecture. The tuned versions use supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to align with human preferences for helpfulness and safety.
|
| 149 |
|
| 150 |
+
# **Run with Ollama [ Ollama Run ]**
|
| 151 |
+
|
| 152 |
+
Ollama simplifies running machine learning models. This guide walks you through downloading, installing, and running GGUF models in minutes.
|
| 153 |
+
|
| 154 |
+
## Table of Contents
|
| 155 |
+
|
| 156 |
+
- [Download and Install](#download-and-install)
|
| 157 |
+
- [Run GGUF Models](#run-gguf-models)
|
| 158 |
+
- [Running the Model](#running-the-model)
|
| 159 |
+
- [Sample Usage](#sample-usage)
|
| 160 |
+
|
| 161 |
+
## Download and Install
|
| 162 |
+
|
| 163 |
+
Download Ollama from [https://ollama.com/download](https://ollama.com/download) and install it on your Windows or Mac system.
|
| 164 |
+
|
| 165 |
+
## Run GGUF Models
|
| 166 |
+
|
| 167 |
+
1. **Create the Model File**
|
| 168 |
+
Create a model file, e.g., `metallama`.
|
| 169 |
+
|
| 170 |
+
2. **Add the Template Command**
|
| 171 |
+
Include a `FROM` line in the file to specify the base model:
|
| 172 |
+
```bash
|
| 173 |
+
FROM Llama-3.2-1B.F16.gguf
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
3. **Create and Patch the Model**
|
| 177 |
+
Run the following command:
|
| 178 |
+
```bash
|
| 179 |
+
ollama create metallama -f ./metallama
|
| 180 |
+
```
|
| 181 |
+
Verify the model with:
|
| 182 |
+
```bash
|
| 183 |
+
ollama list
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
+
## Running the Model
|
| 187 |
+
|
| 188 |
+
Run your model with:
|
| 189 |
+
```bash
|
| 190 |
+
ollama run metallama
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
+
### Sample Usage
|
| 194 |
+
|
| 195 |
+
Interact with the model:
|
| 196 |
+
```plaintext
|
| 197 |
+
>>> write a mini passage about space x
|
| 198 |
+
Space X, the private aerospace company founded by Elon Musk, is revolutionizing the field of space exploration...
|
| 199 |
+
```
|
| 200 |
+
|
| 201 |
+
---
|
| 202 |
+
|
| 203 |
+
With these steps, you can easily run custom models using Ollama. Adjust as needed for your specific use case.
|