Text Generation
Transformers
Safetensors
code
llama
html
css
javascript
instruct
sft
text-generation-inference
Instructions to use caikybaldo999/webcoder-100m-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use caikybaldo999/webcoder-100m-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="caikybaldo999/webcoder-100m-instruct")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("caikybaldo999/webcoder-100m-instruct") model = AutoModelForCausalLM.from_pretrained("caikybaldo999/webcoder-100m-instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use caikybaldo999/webcoder-100m-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "caikybaldo999/webcoder-100m-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "caikybaldo999/webcoder-100m-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/caikybaldo999/webcoder-100m-instruct
- SGLang
How to use caikybaldo999/webcoder-100m-instruct 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 "caikybaldo999/webcoder-100m-instruct" \ --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": "caikybaldo999/webcoder-100m-instruct", "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 "caikybaldo999/webcoder-100m-instruct" \ --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": "caikybaldo999/webcoder-100m-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use caikybaldo999/webcoder-100m-instruct with Docker Model Runner:
docker model run hf.co/caikybaldo999/webcoder-100m-instruct
Full SFT WebCoder-100M-Instruct | 78,226,740 SFT tokens
Browse files- README.md +41 -0
- config.json +32 -0
- generation_config.json +11 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +21 -0
- training_config.json +25 -0
- training_metrics.json +12 -0
README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- code
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
base_model: caikybaldo999/webcoder-100m-html-css-js
|
| 7 |
+
tags:
|
| 8 |
+
- html
|
| 9 |
+
- css
|
| 10 |
+
- javascript
|
| 11 |
+
- instruct
|
| 12 |
+
- sft
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# WebCoder-100M-Instruct
|
| 16 |
+
|
| 17 |
+
Instruction-tuned version of `caikybaldo999/webcoder-100m-html-css-js` specialized in HTML, CSS and JavaScript.
|
| 18 |
+
|
| 19 |
+
## Training
|
| 20 |
+
- Full SFT
|
| 21 |
+
- Parameters: 99,894,528
|
| 22 |
+
- Dataset: `iamtarun/code_instructions_120k_alpaca` filtered for web-development examples
|
| 23 |
+
- Training examples: 30,032
|
| 24 |
+
- Max sequence length: 1024
|
| 25 |
+
- Tokens processed: 78,226,740
|
| 26 |
+
- Supervised response tokens: 48,809,920
|
| 27 |
+
|
| 28 |
+
Loss is masked on system/user tokens and computed on assistant response tokens.
|
| 29 |
+
|
| 30 |
+
## Prompt format
|
| 31 |
+
```text
|
| 32 |
+
<|system|>
|
| 33 |
+
You are WebCoder...<|end|>
|
| 34 |
+
<|user|>
|
| 35 |
+
Create a responsive website...<|end|>
|
| 36 |
+
<|assistant|>
|
| 37 |
+
...
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
## Limitations
|
| 41 |
+
This is a small ~100M parameter model. Review generated code before deployment.
|
config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LlamaForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 2,
|
| 10 |
+
"head_dim": 64,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 768,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 2048,
|
| 15 |
+
"max_position_embeddings": 2048,
|
| 16 |
+
"mlp_bias": false,
|
| 17 |
+
"model_type": "llama",
|
| 18 |
+
"num_attention_heads": 12,
|
| 19 |
+
"num_hidden_layers": 11,
|
| 20 |
+
"num_key_value_heads": 12,
|
| 21 |
+
"pad_token_id": 0,
|
| 22 |
+
"pretraining_tp": 1,
|
| 23 |
+
"rms_norm_eps": 1e-05,
|
| 24 |
+
"rope_parameters": {
|
| 25 |
+
"rope_theta": 10000.0,
|
| 26 |
+
"rope_type": "default"
|
| 27 |
+
},
|
| 28 |
+
"tie_word_embeddings": true,
|
| 29 |
+
"transformers_version": "5.15.0",
|
| 30 |
+
"use_cache": true,
|
| 31 |
+
"vocab_size": 28672
|
| 32 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_sample": true,
|
| 3 |
+
"eos_token_id": 7,
|
| 4 |
+
"max_new_tokens": 768,
|
| 5 |
+
"pad_token_id": 0,
|
| 6 |
+
"repetition_penalty": 1.05,
|
| 7 |
+
"temperature": 0.7,
|
| 8 |
+
"top_k": 50,
|
| 9 |
+
"top_p": 0.92,
|
| 10 |
+
"transformers_version": "5.15.0"
|
| 11 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da8a7d394be4cc33b1f6e6152a7cd6bb5a4f66656d59ff07d8848456a6e557ee
|
| 3 |
+
size 199800304
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|bos|>",
|
| 4 |
+
"eos_token": "<|eos|>",
|
| 5 |
+
"extra_special_tokens": [
|
| 6 |
+
"<|system|>",
|
| 7 |
+
"<|user|>",
|
| 8 |
+
"<|assistant|>",
|
| 9 |
+
"<|end|>"
|
| 10 |
+
],
|
| 11 |
+
"is_local": false,
|
| 12 |
+
"local_files_only": false,
|
| 13 |
+
"max_length": 1024,
|
| 14 |
+
"model_max_length": 2048,
|
| 15 |
+
"pad_token": "<|pad|>",
|
| 16 |
+
"stride": 0,
|
| 17 |
+
"tokenizer_class": "TokenizersBackend",
|
| 18 |
+
"truncation_side": "right",
|
| 19 |
+
"truncation_strategy": "longest_first",
|
| 20 |
+
"unk_token": "<|unk|>"
|
| 21 |
+
}
|
training_config.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"base_model": "caikybaldo999/webcoder-100m-html-css-js",
|
| 3 |
+
"output_repo": "caikybaldo999/webcoder-100m-instruct",
|
| 4 |
+
"dataset_id": "iamtarun/code_instructions_120k_alpaca",
|
| 5 |
+
"max_examples": 40000,
|
| 6 |
+
"validation_fraction": 0.03,
|
| 7 |
+
"max_seq_len": 1024,
|
| 8 |
+
"epochs": 10,
|
| 9 |
+
"micro_batch_size": 16,
|
| 10 |
+
"grad_accum_steps": 4,
|
| 11 |
+
"learning_rate": 5e-05,
|
| 12 |
+
"min_lr_ratio": 0.1,
|
| 13 |
+
"warmup_ratio": 0.05,
|
| 14 |
+
"weight_decay": 0.05,
|
| 15 |
+
"grad_clip": 1.0,
|
| 16 |
+
"max_sft_tokens": 150000000,
|
| 17 |
+
"log_every_updates": 10,
|
| 18 |
+
"eval_every_updates": 100,
|
| 19 |
+
"save_every_updates": 250,
|
| 20 |
+
"eval_batches": 50,
|
| 21 |
+
"work_dir": "/content/webcoder_instruct",
|
| 22 |
+
"use_google_drive": false,
|
| 23 |
+
"drive_dir": "/content/drive/MyDrive/WebCoder100M-Instruct",
|
| 24 |
+
"hub_private": false
|
| 25 |
+
}
|
training_metrics.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"base_model": "caikybaldo999/webcoder-100m-html-css-js",
|
| 3 |
+
"parameters": 99894528,
|
| 4 |
+
"trainable_parameters": 99894528,
|
| 5 |
+
"training_examples": 30032,
|
| 6 |
+
"validation_examples": 929,
|
| 7 |
+
"epochs_completed": 10,
|
| 8 |
+
"updates": 4700,
|
| 9 |
+
"tokens_processed": 78226740,
|
| 10 |
+
"supervised_response_tokens": 48809920,
|
| 11 |
+
"best_val_loss": 1.1705945324897766
|
| 12 |
+
}
|