Instructions to use manupande21/GPT2_PMC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use manupande21/GPT2_PMC with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="manupande21/GPT2_PMC")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("manupande21/GPT2_PMC") model = AutoModelForCausalLM.from_pretrained("manupande21/GPT2_PMC", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use manupande21/GPT2_PMC with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "manupande21/GPT2_PMC" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "manupande21/GPT2_PMC", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/manupande21/GPT2_PMC
- SGLang
How to use manupande21/GPT2_PMC 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 "manupande21/GPT2_PMC" \ --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": "manupande21/GPT2_PMC", "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 "manupande21/GPT2_PMC" \ --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": "manupande21/GPT2_PMC", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use manupande21/GPT2_PMC with Docker Model Runner:
docker model run hf.co/manupande21/GPT2_PMC
Upload folder using huggingface_hub
Browse filesFiles changed (14)
- README.mdAdded+54
- added_tokens.jsonAdded+6
- all_results.jsonAdded+9
- config.jsonAdded+39
- generation_config.jsonAdded+6
- merges.txtAdded
- model.safetensorsAdded+3
- special_tokens_map.jsonAdded+29
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+60
- train_results.jsonAdded+9
- trainer_state.jsonAdded+37
- training_args.binAdded+3
- vocab.jsonAdded
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354---license: mitbase_model: gpt2tags:- generated_from_trainermodel-index:- name: answer_logs 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. -->
# answer_logs
This model is a fine-tuned version of [gpt2](https://huggingface.co/gpt2) on an unknown dataset.
## 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: 5e-05- train_batch_size: 2- eval_batch_size: 8- seed: 42- gradient_accumulation_steps: 8- total_train_batch_size: 16- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08- lr_scheduler_type: linear- num_epochs: 13.0
### Training results
### Framework versions
- Transformers 4.40.2- Pytorch 2.2.1+cu121- Datasets 2.19.1- Tokenizers 0.19.1123456{ "@@A_END@@": 50260, "@@A_START@@": 50259, "@@Q_END@@": 50258, "@@Q_START@@": 50257}123456789{ "epoch": 12.966233766233767, "total_flos": 2608739647488000.0, "train_loss": 2.33007384569217, "train_runtime": 838.3975, "train_samples": 770, "train_samples_per_second": 11.939, "train_steps_per_second": 0.744}123456789101112131415161718192021222324252627282930313233343536373839{ "_name_or_path": "gpt2", "activation_function": "gelu_new", "architectures": [ "GPT2LMHeadModel" ], "attn_pdrop": 0.1, "bos_token_id": 50256, "embd_pdrop": 0.1, "eos_token_id": 50256, "initializer_range": 0.02, "layer_norm_epsilon": 1e-05, "model_type": "gpt2", "n_ctx": 1024, "n_embd": 768, "n_head": 12, "n_inner": null, "n_layer": 12, "n_positions": 1024, "reorder_and_upcast_attn": false, "resid_pdrop": 0.1, "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, "task_specific_params": { "text-generation": { "do_sample": true, "max_length": 50 } }, "torch_dtype": "float32", "transformers_version": "4.40.2", "use_cache": true, "vocab_size": 50261}123456{ "_from_model_config": true, "bos_token_id": 50256, "eos_token_id": 50256, "transformers_version": "4.40.2"}123version https://git-lfs.github.com/spec/v1oid sha256:57359cfb8a4e4aee3a298ed0df8b8958195c9a639db2471fa4f85f629264c01bsize 4977864961234567891011121314151617181920212223242526272829{ "additional_special_tokens": [ "@@Q_START@@", "@@Q_END@@", "@@A_START@@", "@@A_END@@" ], "bos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "unk_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960{ "add_bos_token": false, "add_prefix_space": false, "added_tokens_decoder": { "50256": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": true }, "50257": { "content": "@@Q_START@@", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "50258": { "content": "@@Q_END@@", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "50259": { "content": "@@A_START@@", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "50260": { "content": "@@A_END@@", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "additional_special_tokens": [ "@@Q_START@@", "@@Q_END@@", "@@A_START@@", "@@A_END@@" ], "bos_token": "<|endoftext|>", "clean_up_tokenization_spaces": true, "eos_token": "<|endoftext|>", "errors": "replace", "model_max_length": 1024, "pad_token": null, "tokenizer_class": "GPT2Tokenizer", "unk_token": "<|endoftext|>"}123456789{ "epoch": 12.966233766233767, "total_flos": 2608739647488000.0, "train_loss": 2.33007384569217, "train_runtime": 838.3975, "train_samples": 770, "train_samples_per_second": 11.939, "train_steps_per_second": 0.744}12345678910111213141516171819202122232425262728293031323334353637{ "best_metric": null, "best_model_checkpoint": null, "epoch": 12.966233766233767, "eval_steps": 500.0, "global_step": 624, "is_hyper_param_search": false, "is_local_process_zero": true, "is_world_process_zero": true, "log_history": [ { "epoch": 10.38961038961039, "grad_norm": 1.4692922830581665, "learning_rate": 9.935897435897435e-06, "loss": 2.444, "step": 500 }, { "epoch": 12.966233766233767, "step": 624, "total_flos": 2608739647488000.0, "train_loss": 2.33007384569217, "train_runtime": 838.3975, "train_samples_per_second": 11.939, "train_steps_per_second": 0.744 } ], "logging_steps": 500, "max_steps": 624, "num_input_tokens_seen": 0, "num_train_epochs": 13, "save_steps": 500, "total_flos": 2608739647488000.0, "train_batch_size": 2, "trial_name": null, "trial_params": null}123version https://git-lfs.github.com/spec/v1oid sha256:d044f2b3755134ae31e85323fce571ff7d5b82e7ce4dc5ea150239295f714e49size 4984README.mdAdded+54
added_tokens.jsonAdded+6
all_results.jsonAdded+9
config.jsonAdded+39
generation_config.jsonAdded+6
merges.txtAdded
model.safetensorsAdded+3
special_tokens_map.jsonAdded+29
tokenizer.jsonAdded
tokenizer_config.jsonAdded+60
train_results.jsonAdded+9
trainer_state.jsonAdded+37
training_args.binAdded+3
vocab.jsonAdded