Instructions to use iko-01/ARABIC_poetry2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use iko-01/ARABIC_poetry2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="iko-01/ARABIC_poetry2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("iko-01/ARABIC_poetry2") model = AutoModelForCausalLM.from_pretrained("iko-01/ARABIC_poetry2") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use iko-01/ARABIC_poetry2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "iko-01/ARABIC_poetry2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iko-01/ARABIC_poetry2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/iko-01/ARABIC_poetry2
- SGLang
How to use iko-01/ARABIC_poetry2 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 "iko-01/ARABIC_poetry2" \ --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": "iko-01/ARABIC_poetry2", "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 "iko-01/ARABIC_poetry2" \ --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": "iko-01/ARABIC_poetry2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use iko-01/ARABIC_poetry2 with Docker Model Runner:
docker model run hf.co/iko-01/ARABIC_poetry2
from transformers import pipeline
gen = pipeline("text-generation", model="iko-01/ARABIC_poetry2", tokenizer="iko-01/ARABIC_poetry2", device=0 if torch.cuda.is_available() else -1)
# ุถุน ููุง ุฃู
ุซูุฉ ุงูุงุฎุชุจุงุฑ (ููู
ุงุช ู
ูุฑุฏุฉ ุฃู ุฌู
ู ูุตูุฑุฉ) โ ูู
ููู ุชุนุฏูููุง ุฃู ุฅุถุงูุฉ ุงูู
ุฒูุฏ
prompts = [
"ูุง ููุทููู",
"ููุฏู ุณู
ุนูุชู",
"ุญููู ุงุดุชุฏูู",
"ูุง ุฐุงูุฑุฉู",
"ูููุจู",
"ูู ุงููููู",
]
results = []
for p in prompts:
out = gen(p,
max_new_tokens=150,
do_sample=True,
top_k=50,
top_p=0.95,
temperature=0.8,
num_return_sequences=1)
text = out[0]["generated_text"]
# ูุฑูุฏ ููุท ุงูุฌุฒุก ุงูุฌุฏูุฏ ุจุนุฏ ุงูู prompt (ุฃู ูู
ูู ุฅุฎุฑุงุฌ ุงูุณุทุฑ ููู)
# ููุง ูุญุชูุธ ุจุงููุต ุงููุงู
ู ูู
ุฑููุฉ ุงูุนุฑุถ
results.append({"prompt": p, "output": text})
# ุนุฑุถ ุณุฑูุน
for r in results:
print("PROMPT:", r["prompt"])
print("OUTPUT:", r["output"])
print("-"*40)
- Downloads last month
- -