Instructions to use rovdetection/code-1b-chat-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rovdetection/code-1b-chat-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rovdetection/code-1b-chat-v2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rovdetection/code-1b-chat-v2") model = AutoModelForCausalLM.from_pretrained("rovdetection/code-1b-chat-v2") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rovdetection/code-1b-chat-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rovdetection/code-1b-chat-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rovdetection/code-1b-chat-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rovdetection/code-1b-chat-v2
- SGLang
How to use rovdetection/code-1b-chat-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 "rovdetection/code-1b-chat-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": "rovdetection/code-1b-chat-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 "rovdetection/code-1b-chat-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": "rovdetection/code-1b-chat-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use rovdetection/code-1b-chat-v2 with Docker Model Runner:
docker model run hf.co/rovdetection/code-1b-chat-v2
| { | |
| "best_global_step": 1000, | |
| "best_metric": 0.9919272661209106, | |
| "best_model_checkpoint": "./sft-out/checkpoint-1000", | |
| "epoch": 1.7673352118901597, | |
| "eval_steps": 500, | |
| "global_step": 1000, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.08840267418089397, | |
| "grad_norm": 2.867945432662964, | |
| "learning_rate": 9.800000000000001e-06, | |
| "loss": 1.6486561584472657, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.17680534836178793, | |
| "grad_norm": 2.9991917610168457, | |
| "learning_rate": 1.98e-05, | |
| "loss": 1.33203125, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.26520802254268194, | |
| "grad_norm": 2.570798635482788, | |
| "learning_rate": 1.9854078984834904e-05, | |
| "loss": 1.2356742858886718, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.35361069672357587, | |
| "grad_norm": 2.5860543251037598, | |
| "learning_rate": 1.9408807689542257e-05, | |
| "loss": 1.2118841552734374, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.44201337090446985, | |
| "grad_norm": 2.117816686630249, | |
| "learning_rate": 1.8677654533689287e-05, | |
| "loss": 1.1767095184326173, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 0.5304160450853639, | |
| "grad_norm": 2.276134729385376, | |
| "learning_rate": 1.7682835235935236e-05, | |
| "loss": 1.1405416870117187, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 0.6188187192662578, | |
| "grad_norm": 2.2516863346099854, | |
| "learning_rate": 1.645457687723951e-05, | |
| "loss": 1.128560562133789, | |
| "step": 350 | |
| }, | |
| { | |
| "epoch": 0.7072213934471517, | |
| "grad_norm": 2.084246873855591, | |
| "learning_rate": 1.5030199466302354e-05, | |
| "loss": 1.1079308319091796, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 0.7956240676280457, | |
| "grad_norm": 2.195765495300293, | |
| "learning_rate": 1.3452981989985347e-05, | |
| "loss": 1.0333491516113282, | |
| "step": 450 | |
| }, | |
| { | |
| "epoch": 0.8840267418089397, | |
| "grad_norm": 2.2488884925842285, | |
| "learning_rate": 1.1770847403195836e-05, | |
| "loss": 1.0508524322509765, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 0.8840267418089397, | |
| "eval_loss": 1.025797724723816, | |
| "eval_runtime": 31.5114, | |
| "eval_samples_per_second": 15.867, | |
| "eval_steps_per_second": 1.999, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 0.9724294159898337, | |
| "grad_norm": 2.3597640991210938, | |
| "learning_rate": 1.0034906514152239e-05, | |
| "loss": 1.0521656036376954, | |
| "step": 550 | |
| }, | |
| { | |
| "epoch": 1.060113818443008, | |
| "grad_norm": 2.0308382511138916, | |
| "learning_rate": 8.297905008339677e-06, | |
| "loss": 0.8026390075683594, | |
| "step": 600 | |
| }, | |
| { | |
| "epoch": 1.148516492623902, | |
| "grad_norm": 2.3317034244537354, | |
| "learning_rate": 6.612620797547087e-06, | |
| "loss": 0.6939823150634765, | |
| "step": 650 | |
| }, | |
| { | |
| "epoch": 1.2369191668047959, | |
| "grad_norm": 2.5876853466033936, | |
| "learning_rate": 5.030260389724447e-06, | |
| "loss": 0.6835686492919922, | |
| "step": 700 | |
| }, | |
| { | |
| "epoch": 1.3253218409856897, | |
| "grad_norm": 2.342280149459839, | |
| "learning_rate": 3.598903005150444e-06, | |
| "loss": 0.6746553039550781, | |
| "step": 750 | |
| }, | |
| { | |
| "epoch": 1.4137245151665838, | |
| "grad_norm": 2.354048728942871, | |
| "learning_rate": 2.362039713653581e-06, | |
| "loss": 0.6704821014404296, | |
| "step": 800 | |
| }, | |
| { | |
| "epoch": 1.502127189347478, | |
| "grad_norm": 2.01891827583313, | |
| "learning_rate": 1.3572519804629537e-06, | |
| "loss": 0.6500045776367187, | |
| "step": 850 | |
| }, | |
| { | |
| "epoch": 1.5905298635283718, | |
| "grad_norm": 2.010759115219116, | |
| "learning_rate": 6.150697724044407e-07, | |
| "loss": 0.6556130981445313, | |
| "step": 900 | |
| }, | |
| { | |
| "epoch": 1.6789325377092656, | |
| "grad_norm": 2.3100311756134033, | |
| "learning_rate": 1.580439203075812e-07, | |
| "loss": 0.6622157287597656, | |
| "step": 950 | |
| }, | |
| { | |
| "epoch": 1.7673352118901597, | |
| "grad_norm": 2.064932346343994, | |
| "learning_rate": 6.092342209607083e-11, | |
| "loss": 0.6651800537109375, | |
| "step": 1000 | |
| }, | |
| { | |
| "epoch": 1.7673352118901597, | |
| "eval_loss": 0.9919272661209106, | |
| "eval_runtime": 31.6701, | |
| "eval_samples_per_second": 15.788, | |
| "eval_steps_per_second": 1.989, | |
| "step": 1000 | |
| } | |
| ], | |
| "logging_steps": 50, | |
| "max_steps": 1000, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 2, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 3.876769443016704e+16, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |