Instructions to use Phind/Phind-CodeLlama-34B-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Phind/Phind-CodeLlama-34B-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Phind/Phind-CodeLlama-34B-v2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Phind/Phind-CodeLlama-34B-v2") model = AutoModelForCausalLM.from_pretrained("Phind/Phind-CodeLlama-34B-v2") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Phind/Phind-CodeLlama-34B-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Phind/Phind-CodeLlama-34B-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Phind/Phind-CodeLlama-34B-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Phind/Phind-CodeLlama-34B-v2
- SGLang
How to use Phind/Phind-CodeLlama-34B-v2 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 "Phind/Phind-CodeLlama-34B-v2" \ --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": "Phind/Phind-CodeLlama-34B-v2", "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 "Phind/Phind-CodeLlama-34B-v2" \ --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": "Phind/Phind-CodeLlama-34B-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Phind/Phind-CodeLlama-34B-v2 with Docker Model Runner:
docker model run hf.co/Phind/Phind-CodeLlama-34B-v2
(Possibly) the Highest quality coding dataset on hugging face. And its free for you to use.
I have created LimitlessCodeTraining, my most refined and filtered coding dataset. with over 640,000 lines of pure, high quality coding data. I invite you to further fine tune your model on this data, or add it to your own dataset and retrain your model with it.
Cheers,
Rombodawg
link:
Oh and Please make a 13b model. I know you guys dont want to, but It really helps people who dont have 3090/4090 gpus. Like my 3080 10gb can only run 13b param models when quantized in 4bit.
So please ππ
Oh and Please make a 13b model. I know you guys dont want to, but It really helps people who dont have 3090/4090 gpus. Like my 3080 10gb can only run 13b param models when quantized in 4bit.
So please ππ
My PC has 64GB of RAM and the GPU is 4080 16GB along with i7 13700K. I am using Ubuntu 22.04.
Both llama.cpp and oobabooga work surprisingly well with these 30B and 34B models. Here is the command I used for this CodeLlama, getting 3 tokens/s - quite happy about it!
./main -t 14 -ngl 32 -m models/phind-codellama-34b-v2.Q5_K_M.gguf --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -i -ins --batch-size 256
As someone who has a 3090, even I like 13b models just because of how damn fast they run.
That said maybe EXL2 will save the day for you:
https://huggingface.co/latimar/Phind-Codellama-34B-v2-exl2
Just go for gptq 4 bit made by The Bloke, you only need 20G~ish VRAM, which stuffed the whole 3090, it is about 20tokens/s with exllama2 on textgen webui
@5ven1 bruh 3 tokens per second? Some people have entire projects they need to work on with ai for coding and we need 15-20 tokens per second minimum.
That seemed okay for light use cases like writing shorter scripts. It would be painful for sure for large projects. Awaiting for my 3090 and will then re-test.