Instructions to use flax-community/gpt2-medium-indonesian with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flax-community/gpt2-medium-indonesian with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="flax-community/gpt2-medium-indonesian")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("flax-community/gpt2-medium-indonesian") model = AutoModelForCausalLM.from_pretrained("flax-community/gpt2-medium-indonesian", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use flax-community/gpt2-medium-indonesian with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flax-community/gpt2-medium-indonesian" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "flax-community/gpt2-medium-indonesian", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/flax-community/gpt2-medium-indonesian
- SGLang
How to use flax-community/gpt2-medium-indonesian 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 "flax-community/gpt2-medium-indonesian" \ --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": "flax-community/gpt2-medium-indonesian", "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 "flax-community/gpt2-medium-indonesian" \ --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": "flax-community/gpt2-medium-indonesian", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use flax-community/gpt2-medium-indonesian with Docker Model Runner:
docker model run hf.co/flax-community/gpt2-medium-indonesian
Commit History
reorder "import jax" to avoid the stuck on importing it, change the dataset b25d188
added run finetuning e5e9f73
updated minimal line length 8696911
delete .idea folder 06e1d8a
alvin commited on
update <|endoftext|> tokenizer id from 50257 to 50256 34c19b7
alvin commited on
refactor tokenizer related files with eos token 08d39dc
alvin commited on
change endoftext value to len of tokenizer vocab size 07fc755
fixed mismatched vocab_size between model and tokenizer eb84e5f
alvin commited on
Add bias analysis 83f2ae2
Galuh commited on
Changed very long line to short multi lines to make it easier for editing in IDE. 5e570bf
Update README.md d3d8b57
Galuh commited on
Merge branch 'main' of https://huggingface.co/flax-community/gpt2-medium-indonesian into main 112770f
model udpate 02a615a
Update README.md f50e22b
Galuh commited on
Update README.md 79140ed
Galuh commited on
Update README.md 311c294
Galuh commited on