Text Generation
Transformers
Safetensors
code
llama
llama-2
custom_code
text-generation-inference
4-bit precision
gptq
Instructions to use TheBloke/CodeLlama-7B-Python-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/CodeLlama-7B-Python-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TheBloke/CodeLlama-7B-Python-GPTQ", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TheBloke/CodeLlama-7B-Python-GPTQ", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("TheBloke/CodeLlama-7B-Python-GPTQ", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TheBloke/CodeLlama-7B-Python-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TheBloke/CodeLlama-7B-Python-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheBloke/CodeLlama-7B-Python-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TheBloke/CodeLlama-7B-Python-GPTQ
- SGLang
How to use TheBloke/CodeLlama-7B-Python-GPTQ 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 "TheBloke/CodeLlama-7B-Python-GPTQ" \ --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": "TheBloke/CodeLlama-7B-Python-GPTQ", "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 "TheBloke/CodeLlama-7B-Python-GPTQ" \ --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": "TheBloke/CodeLlama-7B-Python-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TheBloke/CodeLlama-7B-Python-GPTQ with Docker Model Runner:
docker model run hf.co/TheBloke/CodeLlama-7B-Python-GPTQ
Commit History
-
Update base_model formatting
8c41bcf
-
Upload README.md
7350088 -
Upload README.md
af63cd5
-
Upload README.md
c567064 -
Upload README.md
128692d
-
Initial GPTQ model commit
1c1f9d0 -
Initial GPTQ model commit
2ec551d -
Initial GPTQ model commit
3464019 -
Initial GPTQ model commit
a87e43b -
Initial GPTQ model commit
9e15f14 -
Initial GPTQ model commit
7b7b309 -
Initial GPTQ model commit
4f35a0a -
Initial GPTQ model commit
f74495d -
Initial GPTQ model commit
ac40a7f -
Initial GPTQ model commit
2678247 -
Initial GPTQ model commit
2db1fbc -
Initial GPTQ model commit
1f50304 -
Initial GPTQ model commit
0e84f2c -
Initial GPTQ model commit
1a63e50 -
Initial GPTQ model commit
7cb07fc
-
Add pad_token_id to config.json
83e2bad -
Fix generation_config.json
b2caf1e
-
Initial GPTQ model commit
498a765 -
Initial GPTQ model commit
d34d380 -
Initial GPTQ model commit
25b953d -
Initial GPTQ model commit
0848046 -
Initial GPTQ model commit
f05d99d -
Initial GPTQ model commit
47c8166 -
Initial GPTQ model commit
e5d9a68 -
Initial GPTQ model commit
a77a8f7 -
Initial GPTQ model commit
902906f -
Initial GPTQ model commit
26d8615 -
Initial GPTQ model commit
ec952fe -
Initial GPTQ model commit
eaebf2e -
Initial GPTQ model commit
c392d4b -
Initial GPTQ model commit
08b34a3 -
Initial GPTQ model commit
f89a747 -
Initial GPTQ model commit
0b21ab1 -
initial commit
a5993aa