Text Generation
Transformers
PyTorch
Safetensors
gpt2
Generated from Trainer
text-generation-inference
Instructions to use hardikpatel/GPT2_Music_Generation_Trained with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hardikpatel/GPT2_Music_Generation_Trained with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hardikpatel/GPT2_Music_Generation_Trained")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hardikpatel/GPT2_Music_Generation_Trained") model = AutoModelForCausalLM.from_pretrained("hardikpatel/GPT2_Music_Generation_Trained", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hardikpatel/GPT2_Music_Generation_Trained with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hardikpatel/GPT2_Music_Generation_Trained" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hardikpatel/GPT2_Music_Generation_Trained", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hardikpatel/GPT2_Music_Generation_Trained
- SGLang
How to use hardikpatel/GPT2_Music_Generation_Trained 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 "hardikpatel/GPT2_Music_Generation_Trained" \ --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": "hardikpatel/GPT2_Music_Generation_Trained", "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 "hardikpatel/GPT2_Music_Generation_Trained" \ --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": "hardikpatel/GPT2_Music_Generation_Trained", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hardikpatel/GPT2_Music_Generation_Trained with Docker Model Runner:
docker model run hf.co/hardikpatel/GPT2_Music_Generation_Trained
|
Download README.md from hardikpatel/GPT2_Music_Generation_Trained: direct link, hf CLI and curl.
- Browser
- Download file 2.32 kB
-
https://huggingface.co/hardikpatel/GPT2_Music_Generation_Trained/resolve/main/README.md
- Command line
-
hf download hf://hardikpatel/GPT2_Music_Generation_Trained/README.md
-
curl -L -o README.md https://huggingface.co/hardikpatel/GPT2_Music_Generation_Trained/resolve/main/README.md
2.32 kB
| license: mit | |
| tags: | |
| - generated_from_trainer | |
| model-index: | |
| - name: lmd-8bars-2048-epochs10 | |
| results: [] | |
| <!-- This model card has been generated automatically according to the information the Trainer had access to. You | |
| should probably proofread and complete it, then remove this comment. --> | |
| # lmd-8bars-2048-epochs10 | |
| This model is a fine-tuned version of [gpt2](https://huggingface.co/gpt2) on the None dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 1.0086 | |
| ## 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.0005 | |
| - train_batch_size: 8 | |
| - eval_batch_size: 4 | |
| - seed: 1 | |
| - gradient_accumulation_steps: 2 | |
| - total_train_batch_size: 16 | |
| - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08 | |
| - lr_scheduler_type: cosine | |
| - lr_scheduler_warmup_ratio: 0.01 | |
| - num_epochs: 10 | |
| ### Training results | |
| | Training Loss | Epoch | Step | Validation Loss | | |
| |:-------------:|:-----:|:-----:|:---------------:| | |
| | 2.4182 | 0.5 | 4994 | 1.4933 | | |
| | 1.4626 | 1.0 | 9988 | 1.3082 | | |
| | 1.3176 | 1.5 | 14982 | 1.2276 | | |
| | 1.2604 | 2.0 | 19976 | 1.1815 | | |
| | 1.2101 | 2.5 | 24970 | 1.1499 | | |
| | 1.1804 | 3.0 | 29964 | 1.1260 | | |
| | 1.1517 | 3.5 | 34958 | 1.1043 | | |
| | 1.1349 | 4.0 | 39952 | 1.0887 | | |
| | 1.1133 | 4.5 | 44946 | 1.0762 | | |
| | 1.0995 | 5.0 | 49940 | 1.0618 | | |
| | 1.0824 | 5.5 | 54934 | 1.0507 | | |
| | 1.0713 | 6.0 | 59928 | 1.0423 | | |
| | 1.0552 | 6.5 | 64922 | 1.0328 | | |
| | 1.0505 | 7.0 | 69916 | 1.0279 | | |
| | 1.0365 | 7.5 | 74910 | 1.0217 | | |
| | 1.0307 | 8.0 | 79904 | 1.0153 | | |
| | 1.022 | 8.5 | 84898 | 1.0107 | | |
| | 1.0189 | 9.0 | 89892 | 1.0090 | | |
| | 1.0129 | 9.5 | 94886 | 1.0084 | | |
| | 1.0139 | 10.0 | 99880 | 1.0086 | | |
| ### Framework versions | |
| - Transformers 4.30.2 | |
| - Pytorch 2.0.1+cu118 | |
| - Datasets 2.13.1 | |
| - Tokenizers 0.13.3 | |