Text Generation
Transformers
PyTorch
TensorBoard
gpt2
Generated from Trainer
text-generation-inference
Instructions to use human/lm-colab-tutorial with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use human/lm-colab-tutorial with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="human/lm-colab-tutorial")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("human/lm-colab-tutorial") model = AutoModelForCausalLM.from_pretrained("human/lm-colab-tutorial", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use human/lm-colab-tutorial with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "human/lm-colab-tutorial" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "human/lm-colab-tutorial", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/human/lm-colab-tutorial
- SGLang
How to use human/lm-colab-tutorial 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 "human/lm-colab-tutorial" \ --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": "human/lm-colab-tutorial", "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 "human/lm-colab-tutorial" \ --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": "human/lm-colab-tutorial", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use human/lm-colab-tutorial with Docker Model Runner:
docker model run hf.co/human/lm-colab-tutorial
Training in progress, step 500
Browse files- .gitignore +1 -0
- config.json +46 -0
- pytorch_model.bin +3 -0
- runs/Aug11_08-10-23_9d4e5a121616/1660205433.2817044/events.out.tfevents.1660205433.9d4e5a121616.72.1 +3 -0
- runs/Aug11_08-10-23_9d4e5a121616/1660205813.011764/events.out.tfevents.1660205813.9d4e5a121616.72.3 +3 -0
- runs/Aug11_08-10-23_9d4e5a121616/events.out.tfevents.1660205433.9d4e5a121616.72.0 +3 -0
- runs/Aug11_08-10-23_9d4e5a121616/events.out.tfevents.1660205813.9d4e5a121616.72.2 +3 -0
- training_args.bin +3 -0
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
checkpoint-*/
|
config.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "distilgpt2",
|
| 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 |
+
"id2label": {
|
| 13 |
+
"0": "LABEL_0"
|
| 14 |
+
},
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"label2id": {
|
| 17 |
+
"LABEL_0": 0
|
| 18 |
+
},
|
| 19 |
+
"layer_norm_epsilon": 1e-05,
|
| 20 |
+
"model_type": "gpt2",
|
| 21 |
+
"n_ctx": 1024,
|
| 22 |
+
"n_embd": 768,
|
| 23 |
+
"n_head": 12,
|
| 24 |
+
"n_inner": null,
|
| 25 |
+
"n_layer": 6,
|
| 26 |
+
"n_positions": 1024,
|
| 27 |
+
"reorder_and_upcast_attn": false,
|
| 28 |
+
"resid_pdrop": 0.1,
|
| 29 |
+
"scale_attn_by_inverse_layer_idx": false,
|
| 30 |
+
"scale_attn_weights": true,
|
| 31 |
+
"summary_activation": null,
|
| 32 |
+
"summary_first_dropout": 0.1,
|
| 33 |
+
"summary_proj_to_labels": true,
|
| 34 |
+
"summary_type": "cls_index",
|
| 35 |
+
"summary_use_proj": true,
|
| 36 |
+
"task_specific_params": {
|
| 37 |
+
"text-generation": {
|
| 38 |
+
"do_sample": true,
|
| 39 |
+
"max_length": 50
|
| 40 |
+
}
|
| 41 |
+
},
|
| 42 |
+
"torch_dtype": "float32",
|
| 43 |
+
"transformers_version": "4.21.1",
|
| 44 |
+
"use_cache": true,
|
| 45 |
+
"vocab_size": 50257
|
| 46 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e56c2ac1dd4a7067caa47904b2fc91d42043200abaaa70069651d150781b661e
|
| 3 |
+
size 333969117
|
runs/Aug11_08-10-23_9d4e5a121616/1660205433.2817044/events.out.tfevents.1660205433.9d4e5a121616.72.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1afdde1519dac3ae0fc5991d31ac4936a7ec8415eb736a7b6816c50f4c0565e
|
| 3 |
+
size 5464
|
runs/Aug11_08-10-23_9d4e5a121616/1660205813.011764/events.out.tfevents.1660205813.9d4e5a121616.72.3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ef1233c6b5a82dafab47ae082aba7cf05e78c45b962f1e201abf5aa135aa4143
|
| 3 |
+
size 5464
|
runs/Aug11_08-10-23_9d4e5a121616/events.out.tfevents.1660205433.9d4e5a121616.72.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ffc105ad169476707c4a22eb301809a014b11b03cc66601f19d4bd5f59db6f71
|
| 3 |
+
size 4208
|
runs/Aug11_08-10-23_9d4e5a121616/events.out.tfevents.1660205813.9d4e5a121616.72.2
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:022edd75303605b4931497e5d21cac6e5fb5154ab5cc52199a9d51d370204f73
|
| 3 |
+
size 4236
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ef24ebc40e87e62e62e644cceca28104d1d5015ebd5697d077a0b0f174bae665
|
| 3 |
+
size 3375
|