Instructions to use codegood/Katz_GPT2_pretrained with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use codegood/Katz_GPT2_pretrained with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="codegood/Katz_GPT2_pretrained")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("codegood/Katz_GPT2_pretrained") model = AutoModelForCausalLM.from_pretrained("codegood/Katz_GPT2_pretrained", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use codegood/Katz_GPT2_pretrained with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "codegood/Katz_GPT2_pretrained" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "codegood/Katz_GPT2_pretrained", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/codegood/Katz_GPT2_pretrained
- SGLang
How to use codegood/Katz_GPT2_pretrained 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 "codegood/Katz_GPT2_pretrained" \ --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": "codegood/Katz_GPT2_pretrained", "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 "codegood/Katz_GPT2_pretrained" \ --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": "codegood/Katz_GPT2_pretrained", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use codegood/Katz_GPT2_pretrained with Docker Model Runner:
docker model run hf.co/codegood/Katz_GPT2_pretrained
Upload model
Browse files123version https://git-lfs.github.com/spec/v1oid sha256:78fb39f64d0e50c1a9b265fdc09161167980dc4c6e858be48c04419a238ab9f1size 497774208123version https://git-lfs.github.com/spec/v1oid sha256:fe7939393fc73d13bc02dde2dc514076ea9de949c7de93d9cb5f4d990f21ee64size 497774208
model.safetensors+1-1