Instructions to use tensorblock/code_gpt2-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use tensorblock/code_gpt2-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="tensorblock/code_gpt2-GGUF", filename="code_gpt2-Q2_K.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tensorblock/code_gpt2-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/code_gpt2-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf tensorblock/code_gpt2-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/code_gpt2-GGUF:Q2_K # Run inference directly in the terminal: llama cli -hf tensorblock/code_gpt2-GGUF:Q2_K
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf tensorblock/code_gpt2-GGUF:Q2_K # Run inference directly in the terminal: ./llama-cli -hf tensorblock/code_gpt2-GGUF:Q2_K
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf tensorblock/code_gpt2-GGUF:Q2_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf tensorblock/code_gpt2-GGUF:Q2_K
Use Docker
docker model run hf.co/tensorblock/code_gpt2-GGUF:Q2_K
- LM Studio
- Jan
- vLLM
How to use tensorblock/code_gpt2-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tensorblock/code_gpt2-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tensorblock/code_gpt2-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tensorblock/code_gpt2-GGUF:Q2_K
- Ollama
How to use tensorblock/code_gpt2-GGUF with Ollama:
ollama run hf.co/tensorblock/code_gpt2-GGUF:Q2_K
- Unsloth Studio
How to use tensorblock/code_gpt2-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tensorblock/code_gpt2-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for tensorblock/code_gpt2-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for tensorblock/code_gpt2-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use tensorblock/code_gpt2-GGUF with Docker Model Runner:
docker model run hf.co/tensorblock/code_gpt2-GGUF:Q2_K
- Lemonade
How to use tensorblock/code_gpt2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tensorblock/code_gpt2-GGUF:Q2_K
Run and chat with the model
lemonade run user.code_gpt2-GGUF-Q2_K
List all available models
lemonade list
Keep Q2_K/Q3_K_M gguf only
Browse files- code_gpt2-Q3_K_L.gguf +0 -3
- code_gpt2-Q3_K_S.gguf +0 -3
- code_gpt2-Q4_0.gguf +0 -3
- code_gpt2-Q4_K_M.gguf +0 -3
- code_gpt2-Q4_K_S.gguf +0 -3
- code_gpt2-Q5_0.gguf +0 -3
- code_gpt2-Q5_K_M.gguf +0 -3
- code_gpt2-Q5_K_S.gguf +0 -3
- code_gpt2-Q6_K.gguf +0 -3
- code_gpt2-Q8_0.gguf +0 -3
code_gpt2-Q3_K_L.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:f360625af21909f41a29f3dda475aa63a7d4ca445df6ac526218c639c081079d
|
| 3 |
-
size 102093824
|
|
|
|
|
|
|
|
|
|
|
|
code_gpt2-Q3_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:dae56f810678a645dbc5b7609723fbd913ff2fc0e8b22e3fe61aabea92245a58
|
| 3 |
-
size 90149888
|
|
|
|
|
|
|
|
|
|
|
|
code_gpt2-Q4_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:ef1e8101fa3dc7b962e0d56d80a7cc27d363b591456bf8fbd1fd0e04d8d1a31d
|
| 3 |
-
size 106556480
|
|
|
|
|
|
|
|
|
|
|
|
code_gpt2-Q4_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:91a87e08eb596241f798817e2ff57e4c89cd3238d6e72509c966a0e181ef0c2c
|
| 3 |
-
size 112860224
|
|
|
|
|
|
|
|
|
|
|
|
code_gpt2-Q4_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:0a495dcc19d225a9b7b7161817bb2bc33308c5bd2b8ca34ae34674cfbf331eda
|
| 3 |
-
size 106851392
|
|
|
|
|
|
|
|
|
|
|
|
code_gpt2-Q5_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:53ee96c113c290e65cd9f67bef0655951eccc06883d72e0c0ce07c0fb20eab0e
|
| 3 |
-
size 121997984
|
|
|
|
|
|
|
|
|
|
|
|
code_gpt2-Q5_K_M.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:8e313614801667f98a2337016aa71f0d85747daa4b1a04e4f1f6104fc1db4995
|
| 3 |
-
size 126698144
|
|
|
|
|
|
|
|
|
|
|
|
code_gpt2-Q5_K_S.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:b5654d0ac9f372cf481ec07ef2ff0d7d0cc3db902f025951e29451e55eaee76d
|
| 3 |
-
size 121997984
|
|
|
|
|
|
|
|
|
|
|
|
code_gpt2-Q6_K.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:0f4b6996d1cbfc0a90740bc00ca79f2bbb6bd7425aeece2e67d6b8b26d8cec20
|
| 3 |
-
size 138404576
|
|
|
|
|
|
|
|
|
|
|
|
code_gpt2-Q8_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:55cd9f89038d305f1c8852e1f968ed4aa37f456e4dcb9cee351fda2c2f017bb3
|
| 3 |
-
size 177670304
|
|
|
|
|
|
|
|
|
|
|
|