Instructions to use Forest/gpt2-fanfic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Forest/gpt2-fanfic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Forest/gpt2-fanfic")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Forest/gpt2-fanfic") model = AutoModelForCausalLM.from_pretrained("Forest/gpt2-fanfic", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Forest/gpt2-fanfic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Forest/gpt2-fanfic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Forest/gpt2-fanfic", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Forest/gpt2-fanfic
- SGLang
How to use Forest/gpt2-fanfic 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 "Forest/gpt2-fanfic" \ --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": "Forest/gpt2-fanfic", "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 "Forest/gpt2-fanfic" \ --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": "Forest/gpt2-fanfic", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Forest/gpt2-fanfic with Docker Model Runner:
docker model run hf.co/Forest/gpt2-fanfic
Download flax_model.msgpack from Forest/gpt2-fanfic: direct link, hf CLI and curl.
- Browser
- Download file 498 MB
-
https://huggingface.co/Forest/gpt2-fanfic/resolve/main/flax_model.msgpack
- Command line
-
hf download hf://Forest/gpt2-fanfic/flax_model.msgpack
-
curl -L -o flax_model.msgpack https://huggingface.co/Forest/gpt2-fanfic/resolve/main/flax_model.msgpack
498 MB
- Xet hash:
- ae3c68e3b66dce64909ff8202b86db113429564f13f1e6ea1327a5d7a329728e
- Size of remote file:
- 498 MB
- SHA256:
- 19e656cbd45535b461588e721523c305b66ccb2beb289a553826db376cef4c26
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.