Instructions to use nandinib1999/quote-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nandinib1999/quote-generator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nandinib1999/quote-generator")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nandinib1999/quote-generator") model = AutoModelForCausalLM.from_pretrained("nandinib1999/quote-generator") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use nandinib1999/quote-generator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nandinib1999/quote-generator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nandinib1999/quote-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/nandinib1999/quote-generator
- SGLang
How to use nandinib1999/quote-generator 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 "nandinib1999/quote-generator" \ --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": "nandinib1999/quote-generator", "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 "nandinib1999/quote-generator" \ --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": "nandinib1999/quote-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use nandinib1999/quote-generator with Docker Model Runner:
docker model run hf.co/nandinib1999/quote-generator
Quotes Generator
Model description
This is a GPT2 model fine-tuned on the Quotes-500K dataset.
Intended uses & limitations
For a given user prompt, it can generate motivational quotes starting with it.
How to use
from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained("nandinib1999/quote-generator")
model = AutoModelWithLMHead.from_pretrained("nandinib1999/quote-generator")
Training data
This is the distribution of the total dataset into training, validation and test dataset for the fine-tuning task.
| train | 349796 |
|---|---|
| validation | 99942 |
| test | 49971 |
Training procedure
The model was fine-tuned using the Google Colab GPU for one epoch. The weights of the pre-trained GPT2 model were used as a base.
Eval results
| Epoch | Perplexity |
|---|---|
| 1 | 15.180 |
- Downloads last month
- 20