Instructions to use armahlovis/GPT2FinnedtunnedEwriters with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use armahlovis/GPT2FinnedtunnedEwriters with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="armahlovis/GPT2FinnedtunnedEwriters")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("armahlovis/GPT2FinnedtunnedEwriters") model = AutoModelForCausalLM.from_pretrained("armahlovis/GPT2FinnedtunnedEwriters", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use armahlovis/GPT2FinnedtunnedEwriters with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "armahlovis/GPT2FinnedtunnedEwriters" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "armahlovis/GPT2FinnedtunnedEwriters", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/armahlovis/GPT2FinnedtunnedEwriters
- SGLang
How to use armahlovis/GPT2FinnedtunnedEwriters 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 "armahlovis/GPT2FinnedtunnedEwriters" \ --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": "armahlovis/GPT2FinnedtunnedEwriters", "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 "armahlovis/GPT2FinnedtunnedEwriters" \ --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": "armahlovis/GPT2FinnedtunnedEwriters", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use armahlovis/GPT2FinnedtunnedEwriters with Docker Model Runner:
docker model run hf.co/armahlovis/GPT2FinnedtunnedEwriters
GPT2FinnedtunnedEwriters
This model is a fine-tuned version of gpt2 on the writings of W. E. Burghardt Du Bois.
Model description
The model is designed to be finned tunning with writting from Historical black black writers who wrote on freedom and emancipation. This first version has GPT2 fintunned with the writings of W. E. Burghardt Du Bois.
Intended uses & limitations
This can be used to complete sentences where historical context advocating for black freedom and emancipation is required.
Training and evaluation data
The data used in the training consist of the writings of W. E. Burghardt Du Bois. The DarkWater written by Du Bois was downloaded from project Gutenberg using the link https://www.gutenberg.org/files/15210/15210-h/15210-h.htm Specifiically, the chapters used are below THE SHADOW OF the YEAR(12,515 word token), Litany at Atlanta(6,378 word token), THE SOULS OF WHITE FOLK(7301 word token), The Riddle of the Sphinx, THE HANDS OF ETHIOPIA(6378 word Token), The Princess of the Hither Isles(1508 word Token) OF WORK AND WEALTH(7301 word token), Second Coming(1033 word Token), THE SERVANT IN THE HOUSE(6508 word Token), Jesus Christ in Texas(3372 word Token), OF THE RULING OF MEN(7096 word Token), The Call and THE DAMNATION OF WOMEN(6508 word Token). About 50,000 word token was used in the training.
Training procedure
After corpus was put together, the text was preprocessed to remove extra text and license information added by Gutenberg organization. Also the word token was kept below 50,000 words so that it could be trained on basic package provided by Google Colab. It was then tokenized using GPT2Tokenizer and afterwards finned tunned on GPT2.
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 3.0
Training results
Framework versions
- Transformers 4.26.1
- Pytorch 1.13.1+cu116
- Datasets 2.9.0
- Tokenizers 0.13.2
- Downloads last month
- 10