Instructions to use Jar-ai/Water-AI-GPT2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jar-ai/Water-AI-GPT2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Jar-ai/Water-AI-GPT2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Jar-ai/Water-AI-GPT2") model = AutoModelForCausalLM.from_pretrained("Jar-ai/Water-AI-GPT2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Jar-ai/Water-AI-GPT2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jar-ai/Water-AI-GPT2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jar-ai/Water-AI-GPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Jar-ai/Water-AI-GPT2
- SGLang
How to use Jar-ai/Water-AI-GPT2 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 "Jar-ai/Water-AI-GPT2" \ --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": "Jar-ai/Water-AI-GPT2", "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 "Jar-ai/Water-AI-GPT2" \ --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": "Jar-ai/Water-AI-GPT2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Jar-ai/Water-AI-GPT2 with Docker Model Runner:
docker model run hf.co/Jar-ai/Water-AI-GPT2
Download tokenizer.json from Jar-ai/Water-AI-GPT2: direct link, hf CLI and curl.
- Browser
- Download file 2.86 kB
-
https://huggingface.co/Jar-ai/Water-AI-GPT2/resolve/main/tokenizer.json
- Command line
-
hf download hf://Jar-ai/Water-AI-GPT2/tokenizer.json
-
curl -L -o tokenizer.json https://huggingface.co/Jar-ai/Water-AI-GPT2/resolve/main/tokenizer.json
2.86 kB
| { | |
| "version": "1.0", | |
| "truncation": null, | |
| "padding": null, | |
| "added_tokens": [ | |
| { | |
| "id": 0, | |
| "content": "[PAD]", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| }, | |
| { | |
| "id": 1, | |
| "content": "[BOS]", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| }, | |
| { | |
| "id": 2, | |
| "content": "[EOS]", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| } | |
| ], | |
| "normalizer": null, | |
| "pre_tokenizer": { | |
| "type": "Whitespace" | |
| }, | |
| "post_processor": { | |
| "type": "TemplateProcessing", | |
| "single": [ | |
| { | |
| "Sequence": { | |
| "id": "A", | |
| "type_id": 0 | |
| } | |
| } | |
| ], | |
| "pair": [ | |
| { | |
| "Sequence": { | |
| "id": "A", | |
| "type_id": 0 | |
| } | |
| }, | |
| { | |
| "Sequence": { | |
| "id": "B", | |
| "type_id": 1 | |
| } | |
| } | |
| ], | |
| "special_tokens": {} | |
| }, | |
| "decoder": { | |
| "type": "BPEDecoder", | |
| "suffix": "</w>" | |
| }, | |
| "model": { | |
| "type": "BPE", | |
| "dropout": null, | |
| "unk_token": "bloop", | |
| "continuing_subword_prefix": null, | |
| "end_of_word_suffix": null, | |
| "fuse_unk": false, | |
| "byte_fallback": false, | |
| "ignore_merges": false, | |
| "vocab": { | |
| "[PAD]": 0, | |
| "[BOS]": 1, | |
| "[EOS]": 2, | |
| "b": 3, | |
| "g": 4, | |
| "i": 5, | |
| "l": 6, | |
| "o": 7, | |
| "p": 8, | |
| "u": 9, | |
| "bl": 10, | |
| "bu": 11, | |
| "ub": 12, | |
| "blo": 13, | |
| "gl": 14, | |
| "lb": 15, | |
| "blub": 16, | |
| "bi": 17, | |
| "op": 18, | |
| "ulb": 19, | |
| "bll": 20, | |
| "blu": 21, | |
| "bub": 22, | |
| "bubl": 23, | |
| "bulb": 24, | |
| "blop": 25, | |
| "bloop": 26, | |
| "glu": 27, | |
| "glub": 28, | |
| "blubb": 29, | |
| "biulb": 30 | |
| }, | |
| "merges": [ | |
| [ | |
| "b", | |
| "l" | |
| ], | |
| [ | |
| "b", | |
| "u" | |
| ], | |
| [ | |
| "u", | |
| "b" | |
| ], | |
| [ | |
| "bl", | |
| "o" | |
| ], | |
| [ | |
| "g", | |
| "l" | |
| ], | |
| [ | |
| "l", | |
| "b" | |
| ], | |
| [ | |
| "bl", | |
| "ub" | |
| ], | |
| [ | |
| "b", | |
| "i" | |
| ], | |
| [ | |
| "o", | |
| "p" | |
| ], | |
| [ | |
| "u", | |
| "lb" | |
| ], | |
| [ | |
| "bl", | |
| "l" | |
| ], | |
| [ | |
| "bl", | |
| "u" | |
| ], | |
| [ | |
| "bu", | |
| "b" | |
| ], | |
| [ | |
| "bu", | |
| "bl" | |
| ], | |
| [ | |
| "bu", | |
| "lb" | |
| ], | |
| [ | |
| "blo", | |
| "p" | |
| ], | |
| [ | |
| "blo", | |
| "op" | |
| ], | |
| [ | |
| "gl", | |
| "u" | |
| ], | |
| [ | |
| "gl", | |
| "ub" | |
| ], | |
| [ | |
| "blub", | |
| "b" | |
| ], | |
| [ | |
| "bi", | |
| "ulb" | |
| ] | |
| ] | |
| } | |
| } |