Instructions to use ainize/gpt2-mcu-script-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ainize/gpt2-mcu-script-large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ainize/gpt2-mcu-script-large")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ainize/gpt2-mcu-script-large") model = AutoModelForCausalLM.from_pretrained("ainize/gpt2-mcu-script-large") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ainize/gpt2-mcu-script-large with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ainize/gpt2-mcu-script-large" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ainize/gpt2-mcu-script-large", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ainize/gpt2-mcu-script-large
- SGLang
How to use ainize/gpt2-mcu-script-large 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 "ainize/gpt2-mcu-script-large" \ --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": "ainize/gpt2-mcu-script-large", "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 "ainize/gpt2-mcu-script-large" \ --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": "ainize/gpt2-mcu-script-large", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ainize/gpt2-mcu-script-large with Docker Model Runner:
docker model run hf.co/ainize/gpt2-mcu-script-large
Upload from HScomcom
Browse files- config.json +43 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- tokenizer_config.json +1 -0
- training_args.bin +3 -0
- vocab.json +0 -0
config.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "gpt2-large",
|
| 3 |
+
"_num_labels": 1,
|
| 4 |
+
"activation_function": "gelu_new",
|
| 5 |
+
"architectures": [
|
| 6 |
+
"GPT2LMHeadModel"
|
| 7 |
+
],
|
| 8 |
+
"attn_pdrop": 0.1,
|
| 9 |
+
"bos_token_id": 50256,
|
| 10 |
+
"embd_pdrop": 0.1,
|
| 11 |
+
"eos_token_id": 50256,
|
| 12 |
+
"gradient_checkpointing": false,
|
| 13 |
+
"id2label": {
|
| 14 |
+
"0": "LABEL_0"
|
| 15 |
+
},
|
| 16 |
+
"initializer_range": 0.02,
|
| 17 |
+
"label2id": {
|
| 18 |
+
"LABEL_0": 0
|
| 19 |
+
},
|
| 20 |
+
"layer_norm_epsilon": 1e-05,
|
| 21 |
+
"model_type": "gpt2",
|
| 22 |
+
"n_ctx": 1024,
|
| 23 |
+
"n_embd": 1280,
|
| 24 |
+
"n_head": 20,
|
| 25 |
+
"n_inner": null,
|
| 26 |
+
"n_layer": 36,
|
| 27 |
+
"n_positions": 1024,
|
| 28 |
+
"resid_pdrop": 0.1,
|
| 29 |
+
"summary_activation": null,
|
| 30 |
+
"summary_first_dropout": 0.1,
|
| 31 |
+
"summary_proj_to_labels": true,
|
| 32 |
+
"summary_type": "cls_index",
|
| 33 |
+
"summary_use_proj": true,
|
| 34 |
+
"task_specific_params": {
|
| 35 |
+
"text-generation": {
|
| 36 |
+
"do_sample": true,
|
| 37 |
+
"max_length": 50
|
| 38 |
+
}
|
| 39 |
+
},
|
| 40 |
+
"transformers_version": "4.2.2",
|
| 41 |
+
"use_cache": true,
|
| 42 |
+
"vocab_size": 50257
|
| 43 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fabc4542a0cef59b26a8c3080e7cccdcb6ba15ebf8c1324f5d8faa667b183469
|
| 3 |
+
size 3134064907
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"bos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "eos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "unk_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"errors": "replace", "unk_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "bos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "eos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "add_prefix_space": false, "model_max_length": 1024, "name_or_path": "gpt2-large"}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f17d6778e0668befcd9e3371a7055d375005f3821c4f9c9a5a9a35ad2eaa0bec
|
| 3 |
+
size 1967
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|