Instructions to use TheBloke/Phind-CodeLlama-34B-v1-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/Phind-CodeLlama-34B-v1-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TheBloke/Phind-CodeLlama-34B-v1-AWQ")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TheBloke/Phind-CodeLlama-34B-v1-AWQ") model = AutoModelForCausalLM.from_pretrained("TheBloke/Phind-CodeLlama-34B-v1-AWQ") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TheBloke/Phind-CodeLlama-34B-v1-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TheBloke/Phind-CodeLlama-34B-v1-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheBloke/Phind-CodeLlama-34B-v1-AWQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TheBloke/Phind-CodeLlama-34B-v1-AWQ
- SGLang
How to use TheBloke/Phind-CodeLlama-34B-v1-AWQ 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/Phind-CodeLlama-34B-v1-AWQ" \ --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/Phind-CodeLlama-34B-v1-AWQ", "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/Phind-CodeLlama-34B-v1-AWQ" \ --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/Phind-CodeLlama-34B-v1-AWQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TheBloke/Phind-CodeLlama-34B-v1-AWQ with Docker Model Runner:
docker model run hf.co/TheBloke/Phind-CodeLlama-34B-v1-AWQ
unable to load model, safetensors argument error
Thank you for the great work! But i am unable to load this model, i get error:
TypeError: AutoAWQForCausalLM.from_quantized() got an unexpected keyword argument 'safetensors'
when using the code in the model card.
If i remove safetensors from argument, now i get
TypeError: AutoAWQForCausalLM.from_quantized() missing 1 required positional argument: 'quant_filename'
I can't find documentation on how to use safetensors. And I don't see any .pt file in the files and version to load quant_filename.
What i am missing?
Thank you