Run this model with HF Jobs
Run HooshvareLab/gpt2-fa-poetry 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/HooshvareLab/gpt2-fa-poetry. 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/HooshvareLab/gpt2-fa-poetry 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/HooshvareLab/gpt2-fa-poetry. 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/HooshvareLab/gpt2-fa-poetry. 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 HooshvareLab/gpt2-fa-poetry with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HooshvareLab/gpt2-fa-poetry with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HooshvareLab/gpt2-fa-poetry")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HooshvareLab/gpt2-fa-poetry") model = AutoModelForCausalLM.from_pretrained("HooshvareLab/gpt2-fa-poetry", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HooshvareLab/gpt2-fa-poetry with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HooshvareLab/gpt2-fa-poetry" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HooshvareLab/gpt2-fa-poetry", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/HooshvareLab/gpt2-fa-poetry
- SGLang
How to use HooshvareLab/gpt2-fa-poetry 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 "HooshvareLab/gpt2-fa-poetry" \ --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": "HooshvareLab/gpt2-fa-poetry", "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 "HooshvareLab/gpt2-fa-poetry" \ --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": "HooshvareLab/gpt2-fa-poetry", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use HooshvareLab/gpt2-fa-poetry with Docker Model Runner:
docker model run hf.co/HooshvareLab/gpt2-fa-poetry
Persian Poet GPT2
Poets
The model can generate poetry based on your favorite poet, and you need to add one of the following lines as the input the box on the right side or follow the fine-tuning notebook.
<s>رودکی<|startoftext|>
<s>فردوسی<|startoftext|>
<s>کسایی<|startoftext|>
<s>ناصرخسرو<|startoftext|>
<s>منوچهری<|startoftext|>
<s>فرخی سیستانی<|startoftext|>
<s>مسعود سعد سلمان<|startoftext|>
<s>ابوسعید ابوالخیر<|startoftext|>
<s>باباطاهر<|startoftext|>
<s>فخرالدین اسعد گرگانی<|startoftext|>
<s>اسدی توسی<|startoftext|>
<s>هجویری<|startoftext|>
<s>خیام<|startoftext|>
<s>نظامی<|startoftext|>
<s>عطار<|startoftext|>
<s>سنایی<|startoftext|>
<s>خاقانی<|startoftext|>
<s>انوری<|startoftext|>
<s>عبدالواسع جبلی<|startoftext|>
<s>نصرالله منشی<|startoftext|>
<s>مهستی گنجوی<|startoftext|>
<s>باباافضل کاشانی<|startoftext|>
<s>مولوی<|startoftext|>
<s>سعدی<|startoftext|>
<s>خواجوی کرمانی<|startoftext|>
<s>عراقی<|startoftext|>
<s>سیف فرغانی<|startoftext|>
<s>حافظ<|startoftext|>
<s>اوحدی<|startoftext|>
<s>شیخ محمود شبستری<|startoftext|>
<s>عبید زاکانی<|startoftext|>
<s>امیرخسرو دهلوی<|startoftext|>
<s>سلمان ساوجی<|startoftext|>
<s>شاه نعمتالله ولی<|startoftext|>
<s>جامی<|startoftext|>
<s>هلالی جغتایی<|startoftext|>
<s>وحشی<|startoftext|>
<s>محتشم کاشانی<|startoftext|>
<s>شیخ بهایی<|startoftext|>
<s>عرفی<|startoftext|>
<s>رضیالدین آرتیمانی<|startoftext|>
<s>صائب تبریزی<|startoftext|>
<s>فیض کاشانی<|startoftext|>
<s>بیدل دهلوی<|startoftext|>
<s>هاتف اصفهانی<|startoftext|>
<s>فروغی بسطامی<|startoftext|>
<s>قاآنی<|startoftext|>
<s>ملا هادی سبزواری<|startoftext|>
<s>پروین اعتصامی<|startoftext|>
<s>ملکالشعرای بهار<|startoftext|>
<s>شهریار<|startoftext|>
<s>رهی معیری<|startoftext|>
<s>اقبال لاهوری<|startoftext|>
<s>خلیلالله خلیلی<|startoftext|>
<s>شاطرعباس صبوحی<|startoftext|>
<s>نیما یوشیج ( آوای آزاد )<|startoftext|>
<s>احمد شاملو<|startoftext|>
<s>سهراب سپهری<|startoftext|>
<s>فروغ فرخزاد<|startoftext|>
<s>سیمین بهبهانی<|startoftext|>
<s>مهدی اخوان ثالث<|startoftext|>
<s>محمدحسن بارق شفیعی<|startoftext|>
<s>شیون فومنی<|startoftext|>
<s>کامبیز صدیقی کسمایی<|startoftext|>
<s>بهرام سالکی<|startoftext|>
<s>عبدالقهّار عاصی<|startoftext|>
<s>اِ لیـــار (جبار محمدی )<|startoftext|>
Questions?
Post a Github issue on the ParsGPT2 Issues repo.
- Downloads last month
- 941