Text Generation
Transformers
PyTorch
English
gpt2
science fiction
text generation
text-generation-inference
Instructions to use MinzaKhan/HGWells with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MinzaKhan/HGWells with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MinzaKhan/HGWells")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MinzaKhan/HGWells") model = AutoModelForCausalLM.from_pretrained("MinzaKhan/HGWells", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MinzaKhan/HGWells with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MinzaKhan/HGWells" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MinzaKhan/HGWells", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MinzaKhan/HGWells
- SGLang
How to use MinzaKhan/HGWells 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 "MinzaKhan/HGWells" \ --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": "MinzaKhan/HGWells", "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 "MinzaKhan/HGWells" \ --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": "MinzaKhan/HGWells", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MinzaKhan/HGWells with Docker Model Runner:
docker model run hf.co/MinzaKhan/HGWells
Upload tokenizer
Browse filesFiles changed (5)
- added_tokens.jsonAdded+4
- merges.txtAdded
- special_tokens_map.jsonAdded+30
- tokenizer_config.jsonAdded+41
- vocab.jsonAdded
1234{ "<|pad|>": 50258, "<|startoftext|>": 50257}123456789101112131415161718192021222324252627282930{ "bos_token": { "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "pad_token": { "content": "<|pad|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "unk_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}1234567891011121314151617181920212223242526272829303132333435363738394041{ "add_bos_token": false, "add_prefix_space": false, "bos_token": { "__type": "AddedToken", "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "eos_token": { "__type": "AddedToken", "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "errors": "replace", "model_max_length": 1024, "name_or_path": "gpt2", "pad_token": { "__type": "AddedToken", "content": "<|pad|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "special_tokens_map_file": null, "tokenizer_class": "GPT2Tokenizer", "unk_token": { "__type": "AddedToken", "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}added_tokens.jsonAdded+4
merges.txtAdded
special_tokens_map.jsonAdded+30
tokenizer_config.jsonAdded+41
vocab.jsonAdded