Instructions to use ccore/getcode-350m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ccore/getcode-350m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ccore/getcode-350m")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ccore/getcode-350m") model = AutoModelForCausalLM.from_pretrained("ccore/getcode-350m", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ccore/getcode-350m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ccore/getcode-350m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ccore/getcode-350m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ccore/getcode-350m
- SGLang
How to use ccore/getcode-350m 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 "ccore/getcode-350m" \ --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": "ccore/getcode-350m", "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 "ccore/getcode-350m" \ --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": "ccore/getcode-350m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ccore/getcode-350m with Docker Model Runner:
docker model run hf.co/ccore/getcode-350m
| { | |
| "best_metric": 6.1056413650512695, | |
| "best_model_checkpoint": "./opt_trained1/checkpoint-201", | |
| "epoch": 3.9956656346749226, | |
| "eval_steps": 500, | |
| "global_step": 804, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.9956656346749226, | |
| "eval_loss": 6.1056413650512695, | |
| "eval_runtime": 155.9076, | |
| "eval_samples_per_second": 13.809, | |
| "eval_steps_per_second": 1.732, | |
| "step": 201 | |
| }, | |
| { | |
| "epoch": 1.9956656346749226, | |
| "eval_loss": 8.50473690032959, | |
| "eval_runtime": 155.7389, | |
| "eval_samples_per_second": 13.824, | |
| "eval_steps_per_second": 1.734, | |
| "step": 402 | |
| }, | |
| { | |
| "epoch": 2.485448916408669, | |
| "grad_norm": 283244.78125, | |
| "learning_rate": 8.756218905472637e-05, | |
| "loss": 3.2084, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 2.9956656346749226, | |
| "eval_loss": 8.332228660583496, | |
| "eval_runtime": 155.8264, | |
| "eval_samples_per_second": 13.817, | |
| "eval_steps_per_second": 1.733, | |
| "step": 603 | |
| }, | |
| { | |
| "epoch": 3.9956656346749226, | |
| "eval_loss": 8.359700202941895, | |
| "eval_runtime": 155.7968, | |
| "eval_samples_per_second": 13.819, | |
| "eval_steps_per_second": 1.733, | |
| "step": 804 | |
| } | |
| ], | |
| "logging_steps": 500, | |
| "max_steps": 4020, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 20, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 5.446962393985843e+16, | |
| "train_batch_size": 12, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |