Instructions to use prithivMLmods/Viper-Coder-v1.5-r999 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Viper-Coder-v1.5-r999 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/Viper-Coder-v1.5-r999") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/Viper-Coder-v1.5-r999") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/Viper-Coder-v1.5-r999") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use prithivMLmods/Viper-Coder-v1.5-r999 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Viper-Coder-v1.5-r999" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/Viper-Coder-v1.5-r999", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/Viper-Coder-v1.5-r999
- SGLang
How to use prithivMLmods/Viper-Coder-v1.5-r999 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 "prithivMLmods/Viper-Coder-v1.5-r999" \ --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": "prithivMLmods/Viper-Coder-v1.5-r999", "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 "prithivMLmods/Viper-Coder-v1.5-r999" \ --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": "prithivMLmods/Viper-Coder-v1.5-r999", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/Viper-Coder-v1.5-r999 with Docker Model Runner:
docker model run hf.co/prithivMLmods/Viper-Coder-v1.5-r999
Wonderful, could you please share something about SFT?
could you please share something about SFT? Like how to design the dataset, use which finetuning frame.
This model was trained with a low learning rate for 4 to 4.5 hours on 2× A100 SXM GPUs. It is an experimental successor to https://huggingface.co/prithivMLmods/Viper-Coder-v1.1
Regarding dataset preparation, it consists of modular combustion data entries from OpenR1's Code-Cot, Codeforces, Codeforces-Python, Code-Dataset-500K, CodeParrot, Python Core GitHub, Math-Code, and more.
For details on SFT (Supervised Fine-Tuning) and training, you can refer to the following Colab notebook, which I improved from scratch:
https://huggingface.co/datasets/prithivMLmods/Finetune-Colab-Nb/blob/main/SmolLM-FT/SmolLM-FT-360M.ipynb
This model was trained with a low learning rate for 4 to 4.5 hours on 2× A100 SXM GPUs. It is an experimental successor to https://huggingface.co/prithivMLmods/Viper-Coder-v1.1
Regarding dataset preparation, it consists of modular combustion data entries from OpenR1's Code-Cot, Codeforces, Codeforces-Python, Code-Dataset-500K, CodeParrot, Python Core GitHub, Math-Code, and more.
For details on SFT (Supervised Fine-Tuning) and training, you can refer to the following Colab notebook, which I improved from scratch:
https://huggingface.co/datasets/prithivMLmods/Finetune-Colab-Nb/blob/main/SmolLM-FT/SmolLM-FT-360M.ipynb
So nice for your reply! Actually, recently I'm faced with combining private code module(which is so hard to put into prompt) with code LLM(like generate " import a from my_module"), so looking forward for any suggestions. Do you have any suggestions, with training or rag ,etc.
For that, you can follow different strategies in custom @Ken0102030405
You can start by indexing the module’s functions and methods, allowing the LLM to retrieve relevant parts dynamically. Another approach is using system prompts with detailed descriptions of the module. You can also store private module documentation or example code in a vector database and retrieve relevant snippets during generation.
Begin with the easiest method and move on based on your priority.