Text Generation
Transformers
GGUF
code
granite
TensorBlock
GGUF
Eval Results (legacy)
conversational
Instructions to use tensorblock/granite-3b-code-instruct-2k-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tensorblock/granite-3b-code-instruct-2k-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tensorblock/granite-3b-code-instruct-2k-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tensorblock/granite-3b-code-instruct-2k-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tensorblock/granite-3b-code-instruct-2k-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama cli -hf tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
Use Docker
docker model run hf.co/tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
- Llama new
- LM Studio
- Jan
- vLLM
How to use tensorblock/granite-3b-code-instruct-2k-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tensorblock/granite-3b-code-instruct-2k-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tensorblock/granite-3b-code-instruct-2k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
- SGLang
How to use tensorblock/granite-3b-code-instruct-2k-GGUF 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 "tensorblock/granite-3b-code-instruct-2k-GGUF" \ --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": "tensorblock/granite-3b-code-instruct-2k-GGUF", "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 "tensorblock/granite-3b-code-instruct-2k-GGUF" \ --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": "tensorblock/granite-3b-code-instruct-2k-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use tensorblock/granite-3b-code-instruct-2k-GGUF with Ollama:
ollama run hf.co/tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
- Unsloth Desktop
- Docker Model Runner
How to use tensorblock/granite-3b-code-instruct-2k-GGUF with Docker Model Runner:
docker model run hf.co/tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
- Lemonade
How to use tensorblock/granite-3b-code-instruct-2k-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tensorblock/granite-3b-code-instruct-2k-GGUF:Q2_K
Run and chat with the model
lemonade run user.granite-3b-code-instruct-2k-GGUF-Q2_K
List all available models
lemonade list
- Atomic Chat
Update README.md
Browse files
README.md
CHANGED
|
@@ -88,13 +88,13 @@ model-index:
|
|
| 88 |
<div style="width: auto; margin-left: auto; margin-right: auto">
|
| 89 |
<img src="https://i.imgur.com/jC7kdl8.jpeg" alt="TensorBlock" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
| 90 |
</div>
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
|
| 99 |
## ibm-granite/granite-3b-code-instruct-2k - GGUF
|
| 100 |
|
|
|
|
| 88 |
<div style="width: auto; margin-left: auto; margin-right: auto">
|
| 89 |
<img src="https://i.imgur.com/jC7kdl8.jpeg" alt="TensorBlock" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
| 90 |
</div>
|
| 91 |
+
|
| 92 |
+
[](https://tensorblock.co)
|
| 93 |
+
[](https://twitter.com/tensorblock_aoi)
|
| 94 |
+
[](https://discord.gg/Ej5NmeHFf2)
|
| 95 |
+
[](https://github.com/TensorBlock)
|
| 96 |
+
[](https://t.me/TensorBlock)
|
| 97 |
+
|
| 98 |
|
| 99 |
## ibm-granite/granite-3b-code-instruct-2k - GGUF
|
| 100 |
|