Text Generation
Transformers
TensorBoard
Safetensors
gpt2
Generated from Trainer
text-generation-inference
Run this model with HF Jobs
Run ninagroot/GPT2-705M-RUN2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/ninagroot/GPT2-705M-RUN2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ninagroot/GPT2-705M-RUN2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/ninagroot/GPT2-705M-RUN2. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/ninagroot/GPT2-705M-RUN2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use ninagroot/GPT2-705M-RUN2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ninagroot/GPT2-705M-RUN2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ninagroot/GPT2-705M-RUN2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ninagroot/GPT2-705M-RUN2") model = AutoModelForCausalLM.from_pretrained("ninagroot/GPT2-705M-RUN2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ninagroot/GPT2-705M-RUN2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ninagroot/GPT2-705M-RUN2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ninagroot/GPT2-705M-RUN2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ninagroot/GPT2-705M-RUN2
- SGLang
How to use ninagroot/GPT2-705M-RUN2 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 "ninagroot/GPT2-705M-RUN2" \ --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": "ninagroot/GPT2-705M-RUN2", "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 "ninagroot/GPT2-705M-RUN2" \ --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": "ninagroot/GPT2-705M-RUN2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ninagroot/GPT2-705M-RUN2 with Docker Model Runner:
docker model run hf.co/ninagroot/GPT2-705M-RUN2
ninagroot/GPT2-705Mtest
Browse filesFiles changed (14)
- README.mdAdded+68
- added_tokens.jsonAdded+3
- config.jsonAdded+32
- generation_config.jsonAdded+7
- merges.txtAdded
- model.safetensorsAdded+3
- runs/Apr18_09-41-06_gcn43.local.snellius.surf.nl/events.out.tfevents.1713426076.gcn43.local.snellius.surf.nl.1680661.0Added+3
- runs/Apr18_11-42-53_gcn65.local.snellius.surf.nl/events.out.tfevents.1713433381.gcn65.local.snellius.surf.nl.1139270.0Added+3
- runs/Apr18_12-09-23_gcn14.local.snellius.surf.nl/events.out.tfevents.1713434972.gcn14.local.snellius.surf.nl.894979.0Added+3
- special_tokens_map.jsonAdded+6
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+44
- training_args.binAdded+3
- vocab.jsonAdded
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768---tags:- generated_from_trainermodel-index:- name: GPT2-705M results: []---
<!-- This model card has been generated automatically according to the information the Trainer had access to. Youshould probably proofread and complete it, then remove this comment. -->
# GPT2-705M
This model is a fine-tuned version of [](https://huggingface.co/) on an unknown dataset.It achieves the following results on the evaluation set:- Loss: 5.5041
## Model description
More information needed
## Intended uses & limitations
More information needed
## Training and evaluation data
More information needed
## Training procedure
### Training hyperparameters
The following hyperparameters were used during training:- learning_rate: 0.00025- train_batch_size: 16- eval_batch_size: 8- seed: 42- gradient_accumulation_steps: 8- total_train_batch_size: 128- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08- lr_scheduler_type: cosine- lr_scheduler_warmup_steps: 50- num_epochs: 10- mixed_precision_training: Native AMP
### Training results
| Training Loss | Epoch | Step | Validation Loss ||:-------------:|:-----:|:----:|:---------------:|| 7.6866 | 0.98 | 7 | 8.0542 || 6.8762 | 1.96 | 14 | 7.3416 || 6.1904 | 2.95 | 21 | 6.8861 || 5.7933 | 3.93 | 28 | 6.6310 || 5.3583 | 4.91 | 35 | 6.3709 || 4.8424 | 5.89 | 42 | 6.1468 || 4.4728 | 6.88 | 49 | 5.8255 || 3.8852 | 8.0 | 57 | 5.6175 || 3.4495 | 8.98 | 64 | 5.5436 || 3.2287 | 9.82 | 70 | 5.5041 |
### Framework versions
- Transformers 4.39.1- Pytorch 2.1.2+cu121- Datasets 2.16.1- Tokenizers 0.15.0123{ "<|endoftext|>": 12198}1234567891011121314151617181920212223242526272829303132{ "activation_function": "gelu_new", "architectures": [ "GPT2LMHeadModel" ], "attn_pdrop": 0.0, "bos_token_id": 50256, "embd_pdrop": 0.0, "eos_token_id": 50256, "initializer_range": 0.02, "layer_norm_epsilon": 1e-05, "model_type": "gpt2", "n_embd": 1536, "n_head": 8, "n_inner": null, "n_layer": 24, "n_positions": 256, "pad_token_id": 0, "reorder_and_upcast_attn": false, "resid_pdrop": 0.0, "scale_attn_by_inverse_layer_idx": false, "scale_attn_weights": true, "summary_activation": null, "summary_first_dropout": 0.1, "summary_proj_to_labels": true, "summary_type": "cls_index", "summary_use_proj": true, "torch_dtype": "float32", "transformers_version": "4.39.1", "use_cache": true, "vocab_size": 12198}1234567{ "_from_model_config": true, "bos_token_id": 50256, "eos_token_id": 50256, "pad_token_id": 0, "transformers_version": "4.39.1"}123version https://git-lfs.github.com/spec/v1oid sha256:5bed8a252f812d3946366bc6263b0719dd2660d6c6fa33ed368cd4ed8001e733size 2796386080123version https://git-lfs.github.com/spec/v1oid sha256:b3f2bcb0497ed12338dbe3232bfa17ae8f7cf08a155adba1483349c7ff626b15size 74359123version https://git-lfs.github.com/spec/v1oid sha256:e9e0f924bad2bcd533ebf4a112c524c6636522ab0d7d7ada36af8423f256186esize 18745123version https://git-lfs.github.com/spec/v1oid sha256:1a4cc5b06d9d53cd009cb22691bf1d02db7b2f55be575052f2ed3ad02a42be93size 22176123456{ "bos_token": "<s>", "eos_token": "</s>", "pad_token": "<pad>", "unk_token": "<|endoftext|>"}1234567891011121314151617181920212223242526272829303132333435363738394041424344{ "add_prefix_space": false, "added_tokens_decoder": { "0": { "content": "<pad>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "<s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "2": { "content": "</s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "12198": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "bos_token": "<s>", "clean_up_tokenization_spaces": true, "eos_token": "</s>", "model_max_length": 128, "pad_token": "<pad>", "tokenizer_class": "GPT2Tokenizer", "unk_token": "<|endoftext|>"}123version https://git-lfs.github.com/spec/v1oid sha256:f51cd671d71df72bdf5cfdc25fe916cc54fdc35454d912d0063d528cf1c8a8a4size 4984README.mdAdded+68
added_tokens.jsonAdded+3
config.jsonAdded+32
generation_config.jsonAdded+7
merges.txtAdded
model.safetensorsAdded+3
runs/Apr18_09-41-06_gcn43.local.snellius.surf.nl/events.out.tfevents.1713426076.gcn43.local.snellius.surf.nl.1680661.0Added+3
runs/Apr18_11-42-53_gcn65.local.snellius.surf.nl/events.out.tfevents.1713433381.gcn65.local.snellius.surf.nl.1139270.0Added+3
runs/Apr18_12-09-23_gcn14.local.snellius.surf.nl/events.out.tfevents.1713434972.gcn14.local.snellius.surf.nl.894979.0Added+3
special_tokens_map.jsonAdded+6
tokenizer.jsonAdded
tokenizer_config.jsonAdded+44
training_args.binAdded+3
vocab.jsonAdded