Text Generation
Transformers
PyTorch
TensorFlow
JAX
TensorBoard
Persian
gpt2
text-generation-inference
Run this model with HF Jobs
Run flax-community/gpt2-medium-persian on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/flax-community/gpt2-medium-persian. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/flax-community/gpt2-medium-persian on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/flax-community/gpt2-medium-persian. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/flax-community/gpt2-medium-persian. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use flax-community/gpt2-medium-persian with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flax-community/gpt2-medium-persian with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="flax-community/gpt2-medium-persian")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("flax-community/gpt2-medium-persian") model = AutoModelForCausalLM.from_pretrained("flax-community/gpt2-medium-persian", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use flax-community/gpt2-medium-persian 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-persian" # 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-persian", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/flax-community/gpt2-medium-persian
- SGLang
How to use flax-community/gpt2-medium-persian 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-persian" \ --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-persian", "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-persian" \ --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-persian", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use flax-community/gpt2-medium-persian with Docker Model Runner:
docker model run hf.co/flax-community/gpt2-medium-persian
Commit History
-
Saving weights and logs of step 322500
581100d -
Saving weights and logs of step 320000
a95f1d4
-
Saving weights and logs of step 317500
e5bdd3a -
Saving weights and logs of step 315000
c3c9968 -
Saving weights and logs of step 312500
d8590d8 -
Saving weights and logs of step 310000
a84666c -
Saving weights and logs of step 307500
f5b0c1a -
Saving weights and logs of step 305000
03f4913 -
Saving weights and logs of step 302500
f290dcc -
Saving weights and logs of step 300000
8138ee6 -
Saving weights and logs of step 297500
db9d152 -
Saving weights and logs of step 295000
3ee69f4 -
Saving weights and logs of step 292500
62bb902 -
Saving weights and logs of step 290000
a560f72 -
Saving weights and logs of step 287500
b9e0dec -
Saving weights and logs of step 285000
f75d3d7 -
Saving weights and logs of step 282500
6d1b425 -
Saving weights and logs of step 280000
173320d -
Saving weights and logs of step 277500
c3a3f2d -
Saving weights and logs of step 275000
8c9178e -
Saving weights and logs of step 272500
f2924b6 -
Saving weights and logs of step 270000
a767da5 -
Saving weights and logs of step 267500
6326a24 -
Saving weights and logs of step 265000
e6b76d3 -
Saving weights and logs of step 262500
1a82963 -
Saving weights and logs of step 260000
e02b632 -
Saving weights and logs of step 257500
41b6cd7 -
Saving weights and logs of step 255000
8e57fa4 -
Saving weights and logs of step 252500
781f26a -
Saving weights and logs of step 250000
78554d5 -
Saving weights and logs of step 247500
cf6e9d2 -
Saving weights and logs of step 245000
3ea0bc9 -
Saving weights and logs of step 242500
e099260 -
Saving weights and logs of step 240000
b1933d6 -
Saving weights and logs of step 237500
eb04dce -
Saving weights and logs of step 235000
3c3d5d4 -
Saving weights and logs of step 232500
bc90bbd -
Saving weights and logs of step 230000
6e0ec0b -
Saving weights and logs of step 227500
56884e4 -
Saving weights and logs of step 225000
0c8ebb0 -
Saving weights and logs of step 222500
ed0f06b -
Saving weights and logs of step 220000
acec6f6 -
Saving weights and logs of step 217500
b05e3e5
-
Saving weights and logs of step 215000
9490d9f -
Saving weights and logs of step 212500
abf04c2 -
Saving weights and logs of step 210000
e062727 -
Saving weights and logs of step 207500
44538b6 -
Saving weights and logs of step 205000
634f574 -
Saving weights and logs of step 202500
95a3f9f -
Saving weights and logs of step 200000
1174f0a