Text Generation
Transformers
Safetensors
gpt_bigcode
starcoder
agentic-coding
merged
conversational
text-generation-inference
Instructions to use Colby/starcoder-7b-agent-0.1-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Colby/starcoder-7b-agent-0.1-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Colby/starcoder-7b-agent-0.1-merged") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Colby/starcoder-7b-agent-0.1-merged") model = AutoModelForCausalLM.from_pretrained("Colby/starcoder-7b-agent-0.1-merged") 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 Colby/starcoder-7b-agent-0.1-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Colby/starcoder-7b-agent-0.1-merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Colby/starcoder-7b-agent-0.1-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Colby/starcoder-7b-agent-0.1-merged
- SGLang
How to use Colby/starcoder-7b-agent-0.1-merged 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 "Colby/starcoder-7b-agent-0.1-merged" \ --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": "Colby/starcoder-7b-agent-0.1-merged", "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 "Colby/starcoder-7b-agent-0.1-merged" \ --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": "Colby/starcoder-7b-agent-0.1-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Colby/starcoder-7b-agent-0.1-merged with Docker Model Runner:
docker model run hf.co/Colby/starcoder-7b-agent-0.1-merged
Upload folder using huggingface_hub
Browse files- chat_template.jinja +9 -0
- config.json +42 -0
- generation_config.json +6 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +20 -0
chat_template.jinja
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% for message in messages %}{% if message['role'] == 'system' %}<|system|>
|
| 2 |
+
{{ message['content'] }}
|
| 3 |
+
<|end|>
|
| 4 |
+
{% elif message['role'] == 'user' %}<|user|>
|
| 5 |
+
{{ message['content'] }}<|end|>
|
| 6 |
+
{% elif message['role'] == 'assistant' %}<|assistant|>
|
| 7 |
+
{{ message['content'] }}<|end|>
|
| 8 |
+
{% endif %}{% endfor %}{% if add_generation_prompt %}<|assistant|>
|
| 9 |
+
{% endif %}
|
config.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_function": "gelu",
|
| 3 |
+
"add_cross_attention": false,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"GPTBigCodeForCausalLM"
|
| 6 |
+
],
|
| 7 |
+
"attention_softmax_in_fp32": true,
|
| 8 |
+
"attn_pdrop": 0.1,
|
| 9 |
+
"bos_token_id": 0,
|
| 10 |
+
"dtype": "float16",
|
| 11 |
+
"embd_pdrop": 0.1,
|
| 12 |
+
"eos_token_id": 0,
|
| 13 |
+
"inference_runner": 0,
|
| 14 |
+
"initializer_range": 0.02,
|
| 15 |
+
"layer_norm_epsilon": 1e-05,
|
| 16 |
+
"max_batch_size": null,
|
| 17 |
+
"max_sequence_length": null,
|
| 18 |
+
"model_type": "gpt_bigcode",
|
| 19 |
+
"multi_query": true,
|
| 20 |
+
"n_embd": 4096,
|
| 21 |
+
"n_head": 32,
|
| 22 |
+
"n_inner": 16384,
|
| 23 |
+
"n_layer": 42,
|
| 24 |
+
"n_positions": 8192,
|
| 25 |
+
"num_key_value_heads": 1,
|
| 26 |
+
"pad_key_length": true,
|
| 27 |
+
"pad_token_id": null,
|
| 28 |
+
"pre_allocate_kv_cache": false,
|
| 29 |
+
"resid_pdrop": 0.1,
|
| 30 |
+
"scale_attention_softmax_in_fp32": true,
|
| 31 |
+
"scale_attn_weights": true,
|
| 32 |
+
"summary_activation": null,
|
| 33 |
+
"summary_first_dropout": 0.1,
|
| 34 |
+
"summary_proj_to_labels": true,
|
| 35 |
+
"summary_type": "cls_index",
|
| 36 |
+
"summary_use_proj": true,
|
| 37 |
+
"tie_word_embeddings": true,
|
| 38 |
+
"transformers_version": "5.8.0",
|
| 39 |
+
"use_cache": true,
|
| 40 |
+
"validate_runner_input": true,
|
| 41 |
+
"vocab_size": 49156
|
| 42 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": 0,
|
| 5 |
+
"transformers_version": "5.8.0"
|
| 6 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:62dd027b7a5ae41b1b0848ed8b45bca6027baa7d6378ab90dafa475d9c2e1e2c
|
| 3 |
+
size 14654613120
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|endoftext|>",
|
| 5 |
+
"eos_token": "<|end|>",
|
| 6 |
+
"errors": "replace",
|
| 7 |
+
"extra_special_tokens": [
|
| 8 |
+
"<|system|>",
|
| 9 |
+
"<|user|>",
|
| 10 |
+
"<|assistant|>",
|
| 11 |
+
"<|end|>"
|
| 12 |
+
],
|
| 13 |
+
"is_local": false,
|
| 14 |
+
"local_files_only": false,
|
| 15 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 16 |
+
"pad_token": "<|end|>",
|
| 17 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 18 |
+
"unk_token": "<|endoftext|>",
|
| 19 |
+
"vocab_size": 49152
|
| 20 |
+
}
|