Instructions to use mgfrantz/distilgpt2-finetuned-reddit-tifu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mgfrantz/distilgpt2-finetuned-reddit-tifu with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mgfrantz/distilgpt2-finetuned-reddit-tifu")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("mgfrantz/distilgpt2-finetuned-reddit-tifu") model = AutoModelForMultimodalLM.from_pretrained("mgfrantz/distilgpt2-finetuned-reddit-tifu") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mgfrantz/distilgpt2-finetuned-reddit-tifu with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mgfrantz/distilgpt2-finetuned-reddit-tifu" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mgfrantz/distilgpt2-finetuned-reddit-tifu", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mgfrantz/distilgpt2-finetuned-reddit-tifu
- SGLang
How to use mgfrantz/distilgpt2-finetuned-reddit-tifu 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 "mgfrantz/distilgpt2-finetuned-reddit-tifu" \ --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": "mgfrantz/distilgpt2-finetuned-reddit-tifu", "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 "mgfrantz/distilgpt2-finetuned-reddit-tifu" \ --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": "mgfrantz/distilgpt2-finetuned-reddit-tifu", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mgfrantz/distilgpt2-finetuned-reddit-tifu with Docker Model Runner:
docker model run hf.co/mgfrantz/distilgpt2-finetuned-reddit-tifu
YAML Metadata Error:"datasets[0]" with value "reddit_tifu (subset: short)" is not valid. If possible, use a dataset id from https://hf.co/datasets.
mgfrantz/distilgpt2-finetuned-reddit-tifu
This model was trained to as practice for fine-tuning a causal language model. There was no intended use case for this model besides having some fun seeing how different things might be screwed up.
Data
This model was trained on "short" subset of reddit_tifu dataset.
The data was split into 90% train and 10% validation using dataset.train_test_split, with a seed of 0.
To prepare the data for training, the "tldr" and "documents" fields were joined by "\n\n".
When multiple items were in the "tldr" or "documents" fields, only the first item was selected for joining.
These joined documents were tokenized using the "distilgpt2" tokenizer.
Finally, tokenized texts were concatenated end-to-end and split into blocks of 128 tokens.
TODO: Add a different separation token between documents that can be used to stop generation.
Training
This model was trained in Colab by fine-tuning distilgpt2 for 174390 steps (3 epochs).
Default training arguments were used, except for learning_rate=2e-5 and weight_decay=0.01.
At the conclusion of training, a training loss of 3.52 and a validation loss of 3.44 were observed.
- Downloads last month
- 2