Text Generation
Transformers
PyTorch
Safetensors
code
gpt2
shader
custom_code
Eval Results (legacy)
text-generation-inference
Instructions to use Vipitis/santacoder-finetuned-the-stack-glsl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Vipitis/santacoder-finetuned-the-stack-glsl with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Vipitis/santacoder-finetuned-the-stack-glsl", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Vipitis/santacoder-finetuned-the-stack-glsl", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Vipitis/santacoder-finetuned-the-stack-glsl", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Vipitis/santacoder-finetuned-the-stack-glsl with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Vipitis/santacoder-finetuned-the-stack-glsl" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vipitis/santacoder-finetuned-the-stack-glsl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Vipitis/santacoder-finetuned-the-stack-glsl
- SGLang
How to use Vipitis/santacoder-finetuned-the-stack-glsl 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 "Vipitis/santacoder-finetuned-the-stack-glsl" \ --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": "Vipitis/santacoder-finetuned-the-stack-glsl", "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 "Vipitis/santacoder-finetuned-the-stack-glsl" \ --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": "Vipitis/santacoder-finetuned-the-stack-glsl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Vipitis/santacoder-finetuned-the-stack-glsl with Docker Model Runner:
docker model run hf.co/Vipitis/santacoder-finetuned-the-stack-glsl
Revert all changes
Browse filesback to where we started. might be more complicated than hoped :/
- config.json +10 -7
config.json
CHANGED
|
@@ -1,18 +1,21 @@
|
|
| 1 |
{
|
| 2 |
-
|
| 3 |
-
"activation_function": "
|
| 4 |
"architectures": [
|
| 5 |
-
"
|
| 6 |
],
|
| 7 |
-
"
|
| 8 |
-
"multi_query": true,
|
| 9 |
"attn_pdrop": 0.1,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
"bos_token_id": 49152,
|
| 11 |
"embd_pdrop": 0.1,
|
| 12 |
"eos_token_id": 49152,
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
"layer_norm_epsilon": 1e-05,
|
| 15 |
-
"model_type": "
|
| 16 |
"n_embd": 2048,
|
| 17 |
"n_head": 16,
|
| 18 |
"n_inner": 8192,
|
|
@@ -20,7 +23,7 @@
|
|
| 20 |
"n_positions": 2048,
|
| 21 |
"reorder_and_upcast_attn": false,
|
| 22 |
"resid_pdrop": 0.1,
|
| 23 |
-
"
|
| 24 |
"scale_attn_weights": true,
|
| 25 |
"summary_activation": null,
|
| 26 |
"summary_first_dropout": 0.1,
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "bigcode/santacoder",
|
| 3 |
+
"activation_function": "gelu_fast",
|
| 4 |
"architectures": [
|
| 5 |
+
"GPT2LMHeadCustomModel"
|
| 6 |
],
|
| 7 |
+
"attention_head_type": "multiquery",
|
|
|
|
| 8 |
"attn_pdrop": 0.1,
|
| 9 |
+
"auto_map": {
|
| 10 |
+
"AutoConfig": "configuration_gpt2_mq.GPT2CustomConfig",
|
| 11 |
+
"AutoModelForCausalLM": "modeling_gpt2_mq.GPT2LMHeadCustomModel"
|
| 12 |
+
},
|
| 13 |
"bos_token_id": 49152,
|
| 14 |
"embd_pdrop": 0.1,
|
| 15 |
"eos_token_id": 49152,
|
| 16 |
"initializer_range": 0.02,
|
| 17 |
"layer_norm_epsilon": 1e-05,
|
| 18 |
+
"model_type": "gpt2",
|
| 19 |
"n_embd": 2048,
|
| 20 |
"n_head": 16,
|
| 21 |
"n_inner": 8192,
|
|
|
|
| 23 |
"n_positions": 2048,
|
| 24 |
"reorder_and_upcast_attn": false,
|
| 25 |
"resid_pdrop": 0.1,
|
| 26 |
+
"scale_attn_by_inverse_layer_idx": false,
|
| 27 |
"scale_attn_weights": true,
|
| 28 |
"summary_activation": null,
|
| 29 |
"summary_first_dropout": 0.1,
|